Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Disable AutoSave On A Form?

Status
Not open for further replies.

DDTiff

MIS
May 29, 2002
48
US
Hi,

I have a form and everytime I make changes to the existing record or add a new record, MS Access automatically save the record to the database without my confirmation.

My goal is to disable this Autosave, and only save the changes of the existing record or the new record to the database only when I click on the save button.

Thank you in advance for your time and effort.

Diem
 
Hi,

You will have to do something like this:

Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim Msg, Title, Response, Style

Msg = "You are about to update data!" & vbCtrlf
Msg = Msg & "Do you wish to update the record?"
Title = "Save Record?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Response = MsgBox(Msg, Style, Title)

If Response = vbYes Then
MsgBox "Record Saved!", vbOkOnly
Else
DoCmd.RunCommand acCmdUndo
End If

End Sub

While I didn't show you a button command it should give you an idea of where to go. HTH,

jbehrne


If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Hi jbehrne,

Thank you for your help. It works GREAT!! =)

Diem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top