Let me preface this by saying that any coding I have done has been plagierized. I am very new to coding.
In an earlier post I stated that while entering data in a shared database, the users occassionally get the following error – “You can’t go to the specified record. You may be at the end of a recordset”. I received the following reply:
You can get that by doing a MovePrevious when you’re at the first record, or a MoveNext when you are adding a record, i.e. you’re trying to move beyond the current records in the table.
It’s error number 2105, so you can check for that number in your error trapping code and just do nothing (leaving you at the start or the end of the recordset as the case may be).
I would like to do the above but don’t know how to code this or what event to use etc. I have the following code that was created when a used the wizard to create a command button
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
DoCmd.GoToRecord , , acNewRec
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click