F
Fred
Dear Group:
I have built a form, using the wizard to put command
buttons that will move to the NEXT record or PREVIOUS
record. This works, but it needs some refinement.
Presently, if I am on the first record and click the
PREVIOUS record button, I get some built in, generic
Access message. And, if I am on the last record and I
click the NEXT record button, I am advanced to the *new*
record row in the table.
What I would like to happen:
When the form opens the PREVIOUS button is disabled. As
soon as the NEXT is clicked the PREVIOUS button becomes
enabled. Once I reach the final record, the NEXT button
becomes disabled. In short- disable/enable buttons as
needed.
This is what I tried:
In the form's *On Current* event I put the code found
below. It doesn't work. When the form opens, both buttons
are disabled. Any help or pointers would be appreciated.
Thanks. (version- Access 2002)
cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNextRace.Enabled = Not Me.CurrentRecord =
Me.RecordsetClone.RecordCount
I have built a form, using the wizard to put command
buttons that will move to the NEXT record or PREVIOUS
record. This works, but it needs some refinement.
Presently, if I am on the first record and click the
PREVIOUS record button, I get some built in, generic
Access message. And, if I am on the last record and I
click the NEXT record button, I am advanced to the *new*
record row in the table.
What I would like to happen:
When the form opens the PREVIOUS button is disabled. As
soon as the NEXT is clicked the PREVIOUS button becomes
enabled. Once I reach the final record, the NEXT button
becomes disabled. In short- disable/enable buttons as
needed.
This is what I tried:
In the form's *On Current* event I put the code found
below. It doesn't work. When the form opens, both buttons
are disabled. Any help or pointers would be appreciated.
Thanks. (version- Access 2002)
cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNextRace.Enabled = Not Me.CurrentRecord =
Me.RecordsetClone.RecordCount