N
Newbie to Access and VBA
Hi,
I am using command buttons in my form to perform save and to duplicate
records. However, when I open/run my form and start filling the data and
press 'duplicate command' button, I got these errors.
daybefore yesterday it said
'The Command or action 'Copy' not available'
yesterday, it worked fine
and today it is showing me this error :
'The Command or action 'paste' not available'.
However, daybefore yesterday 'paste' worked fine. I am not sure what is
going on with my Access. Can someone please let me know what is
happening....and If and where I am making mistakes and also how can I correct
it.
The code for duplicate command button is shown below.
----------------------------------------------------------------
Private Sub Duplicate_Record_Click()
On Error GoTo Err_Duplicate_Record_Click
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
Me!N_NUMBER_txt = Me.[N_NUMBER_txt] + 1 'unique number to differentiate
the
records
Exit_Duplicate_Record_Click:
Exit Sub
Err_Duplicate_Record_Click:
MsgBox Err.Description
Resume Exit_Duplicate_Record_Click
End Sub
I am using command buttons in my form to perform save and to duplicate
records. However, when I open/run my form and start filling the data and
press 'duplicate command' button, I got these errors.
daybefore yesterday it said
'The Command or action 'Copy' not available'
yesterday, it worked fine
and today it is showing me this error :
'The Command or action 'paste' not available'.
However, daybefore yesterday 'paste' worked fine. I am not sure what is
going on with my Access. Can someone please let me know what is
happening....and If and where I am making mistakes and also how can I correct
it.
The code for duplicate command button is shown below.
----------------------------------------------------------------
Private Sub Duplicate_Record_Click()
On Error GoTo Err_Duplicate_Record_Click
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
Me!N_NUMBER_txt = Me.[N_NUMBER_txt] + 1 'unique number to differentiate
the
records
Exit_Duplicate_Record_Click:
Exit Sub
Err_Duplicate_Record_Click:
MsgBox Err.Description
Resume Exit_Duplicate_Record_Click
End Sub