autosave

A

Allen Browne

Use the BeforeUpdate event procedure of the form. That's the only way to
catch all the possible ways a record might get saved.

1. Set the form's Before Update property to:
[Event Procedure]

2. Click the Build button (...) beside this.
Access opens the code window.

3. Set up the code like this:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Save?", vbYesNo) = vbNo Then
Cancel = True
'Me.Undo
End If
End Sub
 
R

Ruth

Thank-you!
--
:)


Allen Browne said:
Use the BeforeUpdate event procedure of the form. That's the only way to
catch all the possible ways a record might get saved.

1. Set the form's Before Update property to:
[Event Procedure]

2. Click the Build button (...) beside this.
Access opens the code window.

3. Set up the code like this:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Save?", vbYesNo) = vbNo Then
Cancel = True
'Me.Undo
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Ruth said:
I there a way to be prompted before the data on a form is automatically
saved?
 
I

i_takeuti

Ruth said:
Thank-you!
--
:)


Allen Browne said:
Use the BeforeUpdate event procedure of the form. That's the only way to
catch all the possible ways a record might get saved.

1. Set the form's Before Update property to:
[Event Procedure]

2. Click the Build button (...) beside this.
Access opens the code window.

3. Set up the code like this:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Save?", vbYesNo) = vbNo Then
Cancel = True
'Me.Undo
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Ruth said:
I there a way to be prompted before the data on a form is automatically
saved?
 
Top