Results 1 to 2 of 2
  1. #1
    nightangel73 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2014
    Posts
    45

    Help with


    okay I have this code which will undo changes if user click "no"..



    Private Sub Form_BeforeUpdate(Cancel As Integer)

    Dim strMsg As String
    strMsg = "Data has changed."
    strMsg = strMsg & "Do you wish to save the changes?"
    strMsg = strMsg & "Click Yes to Save or No to Discard changes."
    If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
    'do nothing
    Else
    DoCmd.RunCommand acCmdUndo

    ---------------

    what I want is instead of undo the changes that it stays in that same record so that the user can continue editing as needed and then save again.
    Is this possible?

    Many thanks,
    Marilia

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    You are given a Cancel flag at the procedure start: Form_BeforeUpdate(Cancel As Integer)

    else
    cancel = true 'to cancel the edits

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

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