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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompting to Save Changes

Status
Not open for further replies.

MooseMan

IS-IT--Management
Aug 25, 2001
63
CA
Sorry for the poor subjectline in the previous

Back for help.
This seems like a no-brainer but I am unsure how to implement.

I have the following code to prompt the user if the data had changed and to allow an opportunity to undo.

The code is in the "beforeupdate" event of my forms. Here is my problem. On forms with a list of records and record selectors, when I move between records the message box is fired. Where should I put the code so that the user is only promopted when he/she has made a change?

Thanks in advance - Bruce


Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "@Do you wish to save the changes?"
strMsg = strMsg & "@Cick Yes to Save or No to Discard changes."

If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then

Else
DoCmd.RunCommand acCmdUndo

End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top