Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Posts
    189

    Question Unanswered: Any way to "Save a Form" when is closing without asking?

    Hello,
    I would like to know if there is any way to save a form when I hit the "Red Cross Button" without asking me to save changes.

    I've tried:
    Code:
    Sub Form_Close()
    DoCmd.Save acForm,me.name
    End sub
    But no luck.

    Ideas?

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You mean design changes to the form? I should hope not! If you did, then how would you close a form without saving changes? You really don't want to do this! Undo isn't trustworthy!

    DoCmd.Close has an option for saving changes and closing a form automatically, but it would still have to be triggered. Clicking the X button is not really controllable... as far as I know. You might have to try removing it and using your own X button which can call the DoCmd.Close command.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Apr 2008
    Posts
    189
    Mmm, not great news.

    So maybe I try the "Close Button".

    Thank you for your support!

    This forum rocks!

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Quote Originally Posted by pepemosca
    Thank you for your support!

    This forum rocks!
    You're welcome and it sure does!!
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    you can mess with the X using the form_unload event.
    either automate the save in this event, or block the X completely with
    Cancel = True
    in the _unload event.

    do a lot of thinking before you go the Cancel = True route ... it is real easy to end up with an application that wont close at all without the help of TaskManager.

    izy
    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •