Access application on close event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have to run queries as soon as i open aceess DB tht i have developed.

I could run these queries, either when it open up or when the DB closes.

What is the even tthat i have to use to perform this?

Thanks
 
The only way to have an event run when the database closes is to have a form
that's always open (even if it's not visible), and put code in the Close
event of that form.
 
How do i do this??/

I can creat a form. that runs all my queries before the applications closes
or opens.
How do i make this form not invisible.

I am a bit confused. please help!!!!

Thank you,
 
If you want the queries to run when the application first open, you can
create a function that runs your queries and call that function from a macro
named AutoExec (or you can simply run the queries in the AutoExec macro). If
it exists, the AutoExec macro always runs as soon as the application opens.
The other option is to create a form that runs the queries through its Load
event. You can then set that form to open when the application opens
(through Tools | Startup in the menu, assuming Access 97 through 2003)

If you want the queries to run when the application closes, you have to use
the technique I mentioned, which is to put the code that runs the queries in
a form's Close event, and then make sure that form is always open. You can
open a form and not make it visible using the OpenForm action in the
AutoExec macro.
 
I wrote a autoexec macro and still it does not work. Do i have to do anythin
else to this macro to make it work as soon as the application opens
Thanks
 
Back
Top