A
Amir
Hi!
When I press the "new record" button I've made,
I get Error number 2499, which says that I can't
use the GoToRecord action on an object in design mode.
Error occurs on line "DoCmd.GoToRecord , , acNewRec"
If I use Access' navigation buttons, error does not occur.
What can I do?
Here is the button's code:
Private Sub btnAddNewReceiptEvent_Click()
On Error GoTo Err_btnAddNewReceiptEvent_Click
DoCmd.GoToRecord , , acNewRec
If Not IsNull(Me.OpenArgs) Then
Me!ReceiptNumber.SetFocus
Me!ReceiptNumber.Text = Me.OpenArgs
Me!txtProjectName.SetFocus
Me.Requery
End If
Exit_btnAddNewReceiptEvent_Click:
Exit Sub
Err_btnAddNewReceiptEvent_Click:
'MsgBox Err.Description
MsgBox Err.Number & Err.Description, , "error"
Resume Exit_btnAddNewReceiptEvent_Click
End Sub
Regards,
Amir.
When I press the "new record" button I've made,
I get Error number 2499, which says that I can't
use the GoToRecord action on an object in design mode.
Error occurs on line "DoCmd.GoToRecord , , acNewRec"
If I use Access' navigation buttons, error does not occur.
What can I do?
Here is the button's code:
Private Sub btnAddNewReceiptEvent_Click()
On Error GoTo Err_btnAddNewReceiptEvent_Click
DoCmd.GoToRecord , , acNewRec
If Not IsNull(Me.OpenArgs) Then
Me!ReceiptNumber.SetFocus
Me!ReceiptNumber.Text = Me.OpenArgs
Me!txtProjectName.SetFocus
Me.Requery
End If
Exit_btnAddNewReceiptEvent_Click:
Exit Sub
Err_btnAddNewReceiptEvent_Click:
'MsgBox Err.Description
MsgBox Err.Number & Err.Description, , "error"
Resume Exit_btnAddNewReceiptEvent_Click
End Sub
Regards,
Amir.