Not sure we have enough info to guess why the buttons don't work after an edit. Do you have other code in the form? Does it compile?
A few things don't look right to me but it's hard to tell if it's causing your problem.
why use DoCmd.RunCommand acCmdRecordsGoToLast ?
Try DoCmd.GoToRecord , , acLast
The reason I pointed you to the class code was to show you the .Recordset.AbsolutePosition .
When it equals 0 you are at the first record and there are no previous records. Absoluteposition is Zero based.
When your Recordset.RecordCount =Recordset.absoluteposition + 1 you are at the last record.
It's the easiest way to know where you are in your forms recordset.
IT is quite a bit of code for a small database.
Not really. What it is is a custom class. The idea is you write the code once and then you can use it easily in any project. Works on main forms and subforms.
The class module only needs to be copied into your project. You really don't even need to understand it.
Only the previous and next buttons are required. All the rest are optional. Just pass your button names to the class.
If you look at the buttons in my example, there is no code in any of the buttons. Everything is handled by the class.
To use it you only need 3 lines of code. 1 in your declarations (top of module) and 2 in the form load event.
Code:
Dim clsNB As clsFormNavBar
Private Sub Form_Load()
Set clsNB = New clsFormNavBar
clsNB.InitCls Me, Me.cmdPrev, Me.cmdNext, Me.cmdFirst, Me.cmdLast, Me.cmdNew, Me.LblCount, Disable 'You pass your button names and choose your options in this line
End Sub
I never gave much thought to the First and Last buttons (<< and >>) as they only go to the first and last records.
I just added the disable to those buttons in my class. If you want the updated code let me know.