P
PerplexedPeon
I am trying to set up some custom navigation buttons so a user won't be able
to click 'next record' button and be able to go past the end of file. For
some reason I can use the built in navigation to go to the first record then
receive an error when trying to navigate back past the BOF but the same isn't
true for the EOF and the source table ends up with a junk entry. Am I
missing something obvious in Access that is allowing this? If not, what is
the easiest method to stop the 'next' button from going past the EOF?
So far I have tried a code snippet available at applecore and the following
on my own, neither have worked.
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
If rst.EOF Then
MsgBox "Already at last record"
Exit Sub
Else
DoCmd.GoToRecord , , acNext
End If
to click 'next record' button and be able to go past the end of file. For
some reason I can use the built in navigation to go to the first record then
receive an error when trying to navigate back past the BOF but the same isn't
true for the EOF and the source table ends up with a junk entry. Am I
missing something obvious in Access that is allowing this? If not, what is
the easiest method to stop the 'next' button from going past the EOF?
So far I have tried a code snippet available at applecore and the following
on my own, neither have worked.
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
If rst.EOF Then
MsgBox "Already at last record"
Exit Sub
Else
DoCmd.GoToRecord , , acNext
End If