How do I Question user to Save on Close

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a simple form in Access2002 where users
will be modifing data in a memo field.
When they click the close button, I want to
prompt them to Save the changes or not.
How can i do this?

Thank you
 
Put the following code in the click event of your close button:
Dim MsgStr As String
Dim TitleStr As String
MsgStr = "Do You Want To Save?"
TitleStr = "Confirm Save"
If MsgBox(MsgStr,VbYesNo,TitleStr) = VbNo Then
Me.Undo
End If
DoCmd.Close
 
you want to make sure that the data in the field does not get updated so
before close you can do beforeupdate() on the field display message and if NO
then cancel.
 
Assuming that it is a bound control.

Bricker said:
you want to make sure that the data in the field does not get updated so
before close you can do beforeupdate() on the field display message and if NO
then cancel.
 

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

Back
Top