Results 1 to 3 of 3
  1. #1
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52

    Closing Form Save Option

    I currently have your basic If you want to close Yes\No setup.



    If MsgBox("Are you sure you want to exit?", vbYesNo + vbQuestion, _
    "Exit Dialog") = vbNo Then
    Cancel = True
    End If

    But I am thinking that if the form has changes that the user should have option to save then or continue with closing the form. Not sure if this would cover that. If so, I believe above the exit dialog.

    If Me.Dirty Then
    If MsgBox("Do you want to Save?", vbYesNo + vbQuestion, "Save Record") = vbNo Then
    Me.Undo

    End If


    TIA

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You won't need the Do you want to close question, only the Save. If a user hasn't made any changes then it doesn't matter if they close the form.

    The OnClose event does not have the ability to cancel, is this in a close button?

  3. #3
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    The exit dialog is on the UnLoad so it can be cancelled.

    I moved the Me.Dirty to BeforeUpdate and seems to be working fine.

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

Similar Threads

  1. Option Buttons & Save Values
    By Bentley in forum Forms
    Replies: 4
    Last Post: 09-29-2016, 01:46 AM
  2. Closing form w/o save if field is null
    By iDeals in forum Forms
    Replies: 3
    Last Post: 11-04-2015, 07:31 AM
  3. Don't save when closing form
    By thefairman in forum Forms
    Replies: 4
    Last Post: 02-21-2012, 09:00 PM
  4. Don't want to save forms on Refresh or closing
    By accesscoder in forum Forms
    Replies: 5
    Last Post: 09-25-2010, 12:03 AM
  5. Print,save as and export option in report?
    By sunny in forum Reports
    Replies: 1
    Last Post: 07-27-2010, 09:55 AM

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