Results 1 to 4 of 4
  1. #1
    jlgray0127 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    193

    Forms Shutting Down


    I have a form with actions queries that run via VBA when the form closes.
    If something happens and the form closes (Close database with form open, Click X (I can remove this) rather than "Exit Button", the value I need for the action queries to run, is lost and I get the pop up prompting me for the value.

    Is there a way to retain that value( believe I had read this once long ago) so that no matter how the form closes, that value is available for all the action queries to run as the database is closing? Sorry, not a newbie, but drawing a blank and hoping to trigger some of my access friends thoughts on this before putting a great deal of thought in to it...
    Thank you so much in advance. Swamped at work and it's taking away from love of building in Access!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I customize db so users cannot use X close on forms or application, also disable ribbon Exit and Close, disable right click shortcut menu.

    However, if you don't want to go to those extremes, try a global variable declared in a general module. The query cannot reference the variable directly but can call a function that references the variable. Real trick is figuring out where to put code that sets the variable. Also, TempVars might be an option but I have never used them. Or could save value to table and query includes that table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jlgray0127 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    193
    Ha! Simple! I used the table with the value stored. Thanks! If only I'd have taken a minute, it'd of been obvious! I will go for the longer term solution when I can get back to modifying this tool, as it's in a shared environment and need it to be as robust as possible! thanks, again!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    This a multi-user split db? Would several users be in db at same time and each trying to edit this value?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-05-2016, 08:29 AM
  2. Replies: 3
    Last Post: 03-23-2016, 12:45 PM
  3. Replies: 5
    Last Post: 01-10-2016, 05:00 AM
  4. Replies: 2
    Last Post: 11-05-2014, 09:16 AM
  5. Access Shutting Down
    By Daryl2106 in forum Misc
    Replies: 1
    Last Post: 11-25-2011, 07:34 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