How do i enable and disable navigation buttons in Access 2003

N

Niina

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?
 
N

niclive

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
 
M

missinglinq via AccessMonster.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top