Navigation buttons

G

Guest

Hi, I have my own navigation buttons, but if I use the integrated navigation
buttons of the form, my own buttons are not synchronized. If I'm on the last
but one record and I push the integrated next record button, my own next
button is not disabled and Access will produce an error if I click on it. Is
there a way to synchronize my own buttons with the integrated ones, or is the
only way is to disable the integrated ones ? Thanks
 
F

fredg

Hi, I have my own navigation buttons, but if I use the integrated navigation
buttons of the form, my own buttons are not synchronized. If I'm on the last
but one record and I push the integrated next record button, my own next
button is not disabled and Access will produce an error if I click on it. Is
there a way to synchronize my own buttons with the integrated ones, or is the
only way is to disable the integrated ones ? Thanks

Code the form's Current event:

CmdPreviousRecord.Enabled = Not Me.CurrentRecord = 1
CmdNextRecord.Enabled = Me.CurrentRecord = 1 Or Me.CurrentRecord <
Me.Recordset.RecordCount

Change CmdPreviousRecord and CmdNextRecord to whatever the actual
names of your command buttons are.
 

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