My record set is opened on form load. I have 2 buttons (next & previous) on a form that displays records from my recordset which is a table. I can add the default buttons to move through the records, but I also have a separate module that gets called each time it is clicked that does something else. So I need to program it all from scratch. Each button is programmed to move next or previous as long as the recordset is not not EOF or BOF. I should also add that one of the controls on the form is a date and I'd like to search records using a date picker.
called on form load
Public Sub openRecordset()
Set db = CurrentDb
Set rs = db.openRecordset("Exceptions")
End Sub
Next record Button
Private Sub btnNext_Click()
If rs.EOF = True Then
MsgBox ("End of File")
Else
rs.MoveNext
loadButtons
End If
Prev Record Button
Private Sub btnPrev_Click()
If rs.BOF = True Then
MsgBox ("BOF")
Else
rs.MovePrevious
loadButtons
End If