Acess saving fields automatically.... (1 Viewer)

masterkale

AuzSolutions
Local time
Tomorrow, 06:32
Joined
Sep 19, 2006
Messages
22
Hi, Guys

Im wondering is there a way to stop access saving fields automatically...

Example you open up a form eg.frmEmployees (it has the employees details on it)

You click in the address and change it but it was for the wrong person.

You click close and IT SAVED IT AUTOMATICALLY :(

Cheers
Tristan F
 

missinglinq

AWF VIP
Local time
Today, 16:32
Joined
Jun 20, 2003
Messages
6,423
There's a couple of variations of this. If you want to be asked whether to save a record, be it a new record or an existing record that's been edited:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
     Resp = MsgBox("Do You Wish to Save the New/Edited Data ?", vbYesNo + vbQuestion, "UnSaved Data")
     If Resp = vbNo Then
       Me.Undo
     End If
End Sub
If you only want the prompt to save if an existing record has been edited:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
    If Not Me.NewRecord Then
     Resp = MsgBox("Do You Wish to Save the Edited Data ?", vbYesNo + vbQuestion, "UnSaved Data")
     If Resp = vbNo Then
       Me.Undo
     End If
     End If
End Sub
 

masterkale

AuzSolutions
Local time
Tomorrow, 06:32
Joined
Sep 19, 2006
Messages
22
Thank You Verry Much....
 

Users who are viewing this thread

Top Bottom