"Do you want to save the record?" message.

dawkirst

Registered User.
Local time
Today, 18:42
Joined
Sep 1, 2005
Messages
21
Certain fields in my form are required before a record can be saved. I have a "save record" button and a "quit form" button. When the form is quit before a record is saved, all data entered into the form are lost.

This resulted in people entering data that were never saved, because they are used to other databases where a record are saved even if they quit.

Is there a way I can prompt them with a "Do you want to save this record?" message when the form is being quit? (All required fields should still be entered before it can be saved.)

Thanks ahead.
 
Thank you. I'm sure it'll help.
 
What exactly does this code do? I need a bit of explaining to incorporate it into my form.

Code:
If Me.Dirty Then
    Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name

Thanks ahead.
 
Hi dawkirst,
Code:
If Me.Dirty Then
    Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name
Though it does not look like it, setting the Dirty flag to false saves the current record. Many MVP's prefer this method over the more traditional code of DoCmd.RunCommand acCmdSaveRecord
 

Users who are viewing this thread

Back
Top Bottom