?
Solved

MSAccess Application Close Event

Posted on 2011-09-19
12
Medium Priority
?
326 Views
Last Modified: 2012-05-12
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
Comment
Question by:Lambel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 30

Expert Comment

by:Randy Downs
ID: 36562907
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
 
LVL 75
ID: 36562911
" 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
 
LVL 75
ID: 36562920
Number-1:
Just curious ... how does that link relate to this question?

mx
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 61

Expert Comment

by:mbizup
ID: 36563021
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
 

Author Comment

by:Lambel
ID: 36563088
DatabaseMX:  Can I use frmHiddenForm.Visable = False  to hide the form?
0
 
LVL 75
ID: 36563126
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
 
LVL 30

Expert Comment

by:Randy Downs
ID: 36563144
Sorry guys, my post was for another question. Maybe someone will remove.
0
 
LVL 75
ID: 36563158
no prob ... thought that was the case.

mx
0
 

Author Comment

by:Lambel
ID: 36563363
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
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 36563382

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

mx
0
 

Author Closing Comment

by:Lambel
ID: 36563406
That did it - thanks much.

Lynn
0
 
LVL 75
ID: 36563424
ooook ...you are welcome.

mx
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question