Results 1 to 3 of 3
  1. #1
    Evgeny's Avatar
    Evgeny is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    85

    Force form not to save updated fields

    I have following code here, it works fine. But how do i force form not to save updated field on vbNo button.

    Code:
    Private Sub cmd_CloseCustomerInfo_Click()
    
    Dim Answer As String
    
    If Me.Dirty Then
    
    Answer = MsgBox("Do you want save changes?", vbQuestion + vbYesNo, "Confrim")
    
    Select Case Answer
    
    Case vbYes
    
    DoCmd.RunCommand acCmdSaveRecord
    
    DoCmd.RunCommand acCmdClose
    
    Case vbNo
    
    DoCmd.RunCommand acCmdClose
    
    End Select
    
    Else
    
    DoCmd.RunCommand acCmdClose
    
    End If
    
    End Sub
    Thank you

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would probably use the before update event, but you can probably use the Undo method to unwind whatever was done on the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Evgeny's Avatar
    Evgeny is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    85
    DoCmd.RunCommand acCmdUndo worded fine. thank you

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

Similar Threads

  1. Replies: 1
    Last Post: 04-22-2010, 04:54 AM
  2. Replies: 2
    Last Post: 01-29-2010, 11:33 AM
  3. Save and Go to another form - simple yes?
    By durstlaw in forum Forms
    Replies: 1
    Last Post: 12-15-2009, 12:46 AM
  4. Form requesting to save changes
    By stevo2820 in forum Forms
    Replies: 0
    Last Post: 07-30-2007, 07:41 AM
  5. Save only 3 of 4 fields
    By Schwagr in forum Forms
    Replies: 0
    Last Post: 03-24-2006, 05:20 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