Hi,
I saw your post regarding the duplication of records. I am facing a similar problem(but I want this to be done using vba rather than queries)and I want to know if you solved your problem, if so how? Please let me know.
Below is a description of the problem that I am facing
I am using command buttons in my form in MS ACCESS 2000 to perform save and to duplicate values. However, when I open/run my form and start filling the data and press 'duplicate command' button, I got these errors.
Yesterday it said
'The Command or action 'Copy' not available'
and today it is showing me this error :
'The Command or action 'Paste' not available'.
However, yesterday 'Paste' worked fine. I am not sure what is going on with mu Access. Can you please let me know what is happening....
The code for duplicate command button is shown below.
-------------------------------------------------------
Private Sub Duplicates_insert_Click()
On Error GoTo Err_Duplicates_insert_Click
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
If Me.Dirty Then
DoCmd.RunCommand acCmdUndo
Else
End If
Exit_Duplicates_insert_Click:
Exit Sub
Err_Duplicates_insert_Click:
MsgBox Err.Description
Resume Exit_Duplicates_insert_Click
End Sub
--------------------------------------------------
I also tried to save the record first before copying, but I am still getting the same error for 'paste'. The only modification that I did for my code is added a new line with the code
DoCmd.RunCommand acCmdSaveRecord
I also wanted to mention that the code that I used(without save) does work for a particular database(same form that I described before) if it is not saved as a data file/MS access application and just saved as a file.
Can you please let me know if I am missing something here. If so can you please explain me as what I should do as I am new to VBA and Access.
Thanks in advance.I really appreaciate your help