Private Sub cmdNew_Click()
on error got MyErr
DoCmd.GoToRecord acActiveDataObject, , acNewRec
if err.number<>2105 then
Se la risposta ti ha aiutato "Vota Utile". Se ha risolto il problema "Segna Risposta. Rome, Italy
Did this solve your problem?
Sorry this didn't help.
Great! Thanks for marking this as the answer.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
The reason for the error is you are trying to go to a record that doesn't exist. It appears you have tried to create your own "VCR" buttons to navigate through records. The problem with this is you make no provision for when you have reached the first or
last record. So you need to do some trapping here. One way would be to trap and then ignore the error or maybe add a:
MsgBox "You are on the first record!"
in your error trapping. Another way is to check to see if you are on the first or last record before executing the GotoRecord (BTW, you should use DoCmd.RunCommand instead of the older GotoRecord).
Your previous answers gave examples of these. Without knowing how much code you are using its harder to advise. Here is another example: