SteveL13
asked on
Behavoir for two command buttons on a form
I have a form with two command buttons. One creates a new record and the other one closes the form. But if the user has changed data in an existing record that appears in the form I want the user to receive a warning that the change they made will be saved if they answer 'Yes' when either button is clicked. If they answer 'No' then the change should not be made to the record.
And then the New Record button will go ahead and open the form for new data and NOT make the change.
If the Close Form button is clicked then the form will close and the change will not be made.
What would this If MsgBox code look like?
And then the New Record button will go ahead and open the form for new data and NOT make the change.
If the Close Form button is clicked then the form will close and the change will not be made.
What would this If MsgBox code look like?
ASKER
"If the form is dirty, do you want it to ask about saving (as above) before moving to the new record? " = Yes.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Open in new window
Not quite sure what you want the New Record button to do. If the form is dirty, do you want it to ask about saving (as above) before moving to the new record?