How do i enable and disable navigation buttons in Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an access program where i can navigate through records from access
database. I have made 4 navigation buttons (First, Previous, Next and Last)
for a form and now i should make them enabled and disabled depending on which
record i currently am in..

How can i do this?
 
I have an access program where i can navigate through records from access
database. I have made 4 navigation buttons (First, Previous, Next and Last)
for a form and now i should make them enabled and disabled depending on which
record i currently am in..

How can i do this?

Hi, put this code on the forms on current event.Just modify it
according to your form, add error handlers etc and it'll work.

Private Sub Form_Current()
If recordID = "CertainValue" Then
cmdNext.Enabled = False
Else: cmdNext.Enabled = True
End If

End Sub

Good luck.

Nick Masao
 
WHere cmdNext is the name of your "Next" button and cmdPrevious is the name
of your "Previous" button.

Private Sub Form_Current()

If CurrentRecord = RecordsetClone.RecordCount Then
cmdNext.Enabled = False
Else: cmdNext.Enabled = True
End If

If CurrentRecord = 1 Then
cmdPrevious.Enabled = False
Else: cmdPrevious.Enabled = True
End If

End Sub
 
Back
Top