change default behavior of previous and next record buttons

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.
 
R

Rick Brandt

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.
 
Q

qye2020

Thanks, it works. However it prevented user from adding next record, i have
an add button explicitly allow them to add new record.
 
G

George Nicholson

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.
 
R

Rick Brandt

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?
 

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