Results 1 to 2 of 2
  1. #1
    FormerJarHead is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    52

    Before Update Messag Box

    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]

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Have you tried stepping through the code at runtime to make sure that it does actually run.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 11-05-2014, 05:27 PM
  2. Replies: 14
    Last Post: 08-12-2014, 06:33 AM
  3. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  4. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  5. Replies: 1
    Last Post: 01-22-2011, 12:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums