Stopping an automatic save

G

Guest

I am using Access 2003
I have a form that non-access users are using to change and update
information equipment informatio.
Currently, we are having a problem with people changing information for the
wrong item and not realizing it until they have closed the screen. I want to
make the form is secure so that it does not automatically save without the
operator saying "Yes", this form is OK, Save".
How do I do this? I was thinking about a save macro, but what happens when
someone ignors the save button and goes directly to the little black "x" to
close out of the screen? I do not know how to write code. If this is the
only way, please tell me where on the form to go and exactly what I need to
write. I would appreciate any help someone can give me.

thank you - aurora
 
J

John Vinson

How do I do this? I was thinking about a save macro, but what happens when
someone ignors the save button and goes directly to the little black "x" to
close out of the screen? I do not know how to write code. If this is the
only way, please tell me where on the form to go and exactly what I need to
write. I would appreciate any help someone can give me.

I'd suggest in fact using code. It's not that hard!

Open the Form in design view, and view its Properties (use the View
menu or right mouseclick the little square at the upper left
intersection of the rulers if you don't see the Properties window).

Select the Events tab and click the ... icon next to the form's Before
Update event. Choose "Code Builder". Access will give you the Sub and
End Sub lines for free; just edit them to read:

Private Sub Form_BeforeUpdate(Cancel as Integer)
Dim iAns As Integer
iAns = MsgBox("Do you REALLY want to make this change?", vbYesNo)
If iAns = vbNo Then
Cancel = True
End If
End Sub


If you want to erase what they've done on the form if they do decide
not to save, you can add a line right before the Cancel = True line:

Me.Undo

to undo all their changes.

John W. Vinson[MVP] ]
 

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

Top