[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

MSAccess Application Close Event

I need to run a procedure that will delete all the tables and table links in my mdb file when the application closes.  Where is the best place to trigger this?  Is there an application On_Close event?

Thanks,
Lynn
0
Lambel
Asked:
Lambel
  • 6
  • 3
  • 2
  • +1
1 Solution
 
Randy DownsOWNERCommented:
Maybe this will help

http://forums.techguy.org/windows-xp/472515-windows-xp-icons-highlighted.html

Display properties->customize desktop->clicked on the web tab->and in the "Web pages" box there was a "\" that was checked.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
" Is there an application On_Close event?"
Unfortunately, no.  This feature has been requested many times.

One way is to have a hidden form that opens with your app.  Then, in the UnLoad event of that form you can run your code to do whatever you need.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Number-1:
Just curious ... how does that link relate to this question?

mx
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
mbizupCommented:
If your database exits abnormally, your procedure would not run.

Are you trying to set the database up for the next session?

It seems like the most reliable time to do this would be at startup rather than exit/closing.


0
 
LambelAuthor Commented:
DatabaseMX:  Can I use frmHiddenForm.Visable = False  to hide the form?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You can open the Form like this ... possibly from an Auto Exec macro that runs start up code ... or directly in the Macro as an Action.

DoCmd.OpenForm "YourFormName",,,,,acHidden
0
 
Randy DownsOWNERCommented:
Sorry guys, my post was for another question. Maybe someone will remove.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
no prob ... thought that was the case.

mx
0
 
LambelAuthor Commented:
Ok, I've got the form opening up in hidden mode, but now the DoCmd.Close "frmHiddenForm" is erroring out with a "type mismatch".
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:

I think you want:
Docmd.Close acForm,"frmHiddenForm"

mx
0
 
LambelAuthor Commented:
That did it - thanks much.

Lynn
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
ooook ...you are welcome.

mx
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 6
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now