How do I Question user to Save on Close

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
 
P

PC Datasheet

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
 
B

Bricker

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

Bricker

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