change default behavior of previous and next record buttons

  • Thread starter Thread starter qye2020
  • Start date Start date
Q

qye2020

Access's default go to next button is to go to a blank form after reaching
last record, how can I change this behavior, I would like this way, if user
click next button one more time after he reachs the last record, a message
pop up shows already on last record and stay in last record, not shows a
blank new record and default error"can't go to specific record".

Thanks in adavance.
 
qye2020 said:
Access's default go to next button is to go to a blank form after reaching
last record, how can I change this behavior, I would like this way, if user
click next button one more time after he reachs the last record, a message
pop up shows already on last record and stay in last record, not shows a
blank new record and default error"can't go to specific record".

Change the AllowAdditions property of the form to No. Then the button will
"gray out" in those situations.
 
Thanks, it works. However it prevented user from adding next record, i have
an add button explicitly allow them to add new record.
 
I don't think it is possible to change the behavior of the default buttons
themselves.

One Option: change the "AllowAdditions" property of the Form itself to
False.

This disables the [>*] button. It also disables the NextRecord button when
the form is on the last record. When combined, these 2 changes prohibit
moving to a new "blank" record. It would not provide the kind of warning
messages you describe (although you could add some code to the
Form_OnCurrent event if you wanted to).

If you wanted users to have the ability to add records, you would also need
to provide some mechanism to do that.

Or you could create and code your own set of custom buttons.
 
qye2020 said:
Thanks, it works. However it prevented user from adding next record, i have
an add button explicitly allow them to add new record.

If you want them to be able to add new records then why do you want to
disable the [>] button when they are on the last existing record?
 
Back
Top