Prompt users to save after changes to existing records

A

AFN Maintainer

i am very new to access, and i am trying figure out how to have access prompt
users to save changes to data on forms before the form is closed.
 
B

Baz

AFN Maintainer said:
i am very new to access, and i am trying figure out how to have access prompt
users to save changes to data on forms before the form is closed.

Access saves changes automatically when the form is closed.
 
A

AFN Maintainer

I realize this. But is there a way that access can prompt the member before
or after data has been changed in a field?
 
G

Gijs Beukenoot

From AFN Maintainer :
I realize this. But is there a way that access can prompt the member before
or after data has been changed in a field?

Use the beforeupdate-event and the dirty property of the form. You can
then use the undo to undo any changes.
Although, somewhere vague, I can remember that working with subforms
affects the dirty property in a bad manner...
 
A

AFN Maintainer

What do I need to do to accomplish this task?

Gijs Beukenoot said:
From AFN Maintainer :

Use the beforeupdate-event and the dirty property of the form. You can
then use the undo to undo any changes.
Although, somewhere vague, I can remember that working with subforms
affects the dirty property in a bad manner...
 
G

Gijs Beukenoot

From AFN Maintainer :
How do I go about doing this? What do I need to do?
<snap!>
Something like
If Me.Dirty Then
Call Beep
Dim iAnswer As Integer
iAnswer = MsgBox("Save changes?", vbQuestion + vbYesNoCancel)
If iAnswer = vbYes Then
Call DoCmd.RunCommand(acCmdSaveRecord)
Call DoCmd.Close(acForm, Me.Name)
ElseIf iAnswer = vbNo Then
Call DoCmd.Close(acForm, Me.Name, acSaveNo)
End If
Else
Call DoCmd.Close(acForm, Me.Name)
End If

(this one is for the unload of the form but can be easily modified to
work on, for example, the beforeupdate)
 
A

AFN Maintainer

thank you. but unfortunately it did not work. how can it be modified to work
 
A

AFN Maintainer

thank you. but unfortunately this did not work. how can this be modified to
work with the beforeupdate.
 
Top