Disable these buttons ! ! !

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

I've added some buttons to my application. They are allowing to move between
records. (goto first record, goto previous, next and last record)

How do you disable the first two buttons when you're on 1st record,
and the last two when you're on the last record?

Can you write this code in Visual Basic, and not using macros?

Thanks!
 
Here is some code that can go in your form's Current event. The code is
for the cmdPrevious and cmdNext buttons - just dupe the appropriate lines
(and change control names) to enable/disable the First Record and Last
Record buttons.

Me.RecordsetClone.MoveLast
cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = Not Me.CurrentRecord = Me.RecordsetClone.RecordCount
 
Back
Top