Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm using access 2003 forms and database.

I am saving records in database and it is working.

I have a button command 'exit' to close the form and it is working with "docmd.close".

I want to call yes/no dialog on exit buttonin case there are errors in the form and the user can click exit button without updating data with update button.

If it is updated, data after entry yes/no dialog should not count, and form should be closed

Please help me, thanks in advance
Posted
Updated 30-Nov-10 1:54am
v2
Comments
Dalek Dave 30-Nov-10 7:53am    
Edited for Grammar, Syntax and Readability.

1 solution

Before the DoCmd.Close statement, you could insert

If MsgBox("Do you want to save your changes?", vbYesNo Or vbQuestion) = vbYes Then
    ' save the changes here
End If


in your "exit" button's "click" event handler.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900