randolphoralph
Registered User.
- Local time
- Today, 11:18
- Joined
- Aug 4, 2008
- Messages
- 101
On my main form I have the Form On Current event set to Me.AllowAdditions = False to prevent new records from being added when users use the scroll button on the mouse.
In order to add a new record users have to click on a command button. Here is the code when the command button is clicked.
I receive a Run-time error '2105': You can't go to the specified record.
When I click on Debug it points to DoCmd.GoToRecord acActiveDataObject, , acNewRec
The funny thing is that the code worked in an older database .mdb, but will not work in the newer .accdb.
Any thoughts?
In order to add a new record users have to click on a command button. Here is the code when the command button is clicked.
Code:
Private Sub CommandButton_Click()
Me.AllowAdditions = True
DoCmd.GoToRecord acActiveDataObject, , acNewRec
End Sub
I receive a Run-time error '2105': You can't go to the specified record.
When I click on Debug it points to DoCmd.GoToRecord acActiveDataObject, , acNewRec
The funny thing is that the code worked in an older database .mdb, but will not work in the newer .accdb.
Any thoughts?