Hi All...
I would like to have a message box that pops up when changes are made to the form or subform. The form is closed using a command button, if it matters. I found the following on line and thought it would work and I could change the wording a bit if needed. When I pasted it to the event procedure, I get no errors, but I also get no message if a change is made. I tried change the quantity of an item I ordered last week and when I used the button to close the form, the form closed, but no message. Can anyone see what I've got wrong or is the completely wrong approach? Thank you.
[Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Changes have been made to this record." _
& vbCrLf & vbCrLf & "Do you want to save these changes?" _
, vbYesNo, "Changes Made...") = vbYes Then
DoCmd.Save
Else
DoCmd.RunCommand acCmdUndo
End If
End Sub]