Record navigation buttons

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi All

I would be grateful for any help/advice on the following:

On my main data entry form I have removed the navigation
buttons and created my own using the command button
wizard. I would now like these buttons to
act “intelligently” depending on where I am in the record
set:

At first record:First record and Prev record buttons
should be disabled
At Last record:Last record and Next record (I have a
separate button to set a new record) should be disabled
At intermediate records all buttons enabled

From my limited knowledge of VBA I would imagine I need an
event procedure attached to my form’s “on current”
property. Any help with the code would be appreciated.
Also having removed the standard navigation buttons I
cannot see which number record I am looking at. Is there
another way of showing this on my form in the
format “Record 99 of 100” for example?

Thanks for any help anyone is able to provide

Chris
 
Use the Form_Current Event with code similar to:

With Me
.cmdFirst.Enabled = (.CurrentRecord <> 1)
.cmdPrev.Enabled = (.CurrentRecord <> 1)
.cmdNext.Enabled = (.CurrentRecord <> .RecordsetClone.RecordCount)
.cmdLast.Enabled = (.CurrentRecord <> .RecordsetClone.RecordCount)
End With
 
Back
Top