Very first event to fire

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

Guest

Using Office 2003 and Windows XP;

I would like to fire a program as the very first thing as a DB opens.

What is the very earliest or very first event detected when a DB is opened?

My DB has a Main Menu that is opened automatically from the start menu. Is
the first event then, ON LOAD? or is there something else that fires before
this? An AutoExec macro perhaps?

Thanks much in advance.
 
XP said:
Using Office 2003 and Windows XP;

I would like to fire a program as the very first thing as a DB opens.

What is the very earliest or very first event detected when a DB is opened?

My DB has a Main Menu that is opened automatically from the start menu. Is
the first event then, ON LOAD? or is there something else that fires before
this? An AutoExec macro perhaps?

Thanks much in advance.

If you have a form that is specified to automatically open in your startup
properties then the first events will be...

Open
Load
Resize
Activate
Current

....for that form. A macro named AutoExec will also fire automatically at
startup but it will fire after the events described above if you also have a
form set in your startup properties.
 
XP said:
Using Office 2003 and Windows XP;

I would like to fire a program as the very first thing as a DB opens.

What is the very earliest or very first event detected when a DB is opened?

My DB has a Main Menu that is opened automatically from the start menu.
[...]

It is not clear to me what you mean here. Menus do not trigger events.
Any menu is loaded and waits for the user to click it.

Trying to clarify:

- you have an Autoexec macro
- you have set, say "frmStartup", in the menu
Tools/Startup.../Display Form/Page

Then the event Form_Open of frmStartup will fire before the Autoexec
macro is being run. The Form_Open event is the first event that is
triggered when opening a form.

But you could, as well, have set the "Display Form/Page" value to
"(none") and have an Autoexec macro whose only action is to call your
Startup function:

Autoexec Macro
Action: RunCode
Function Name: MyStratup()

where

Public Function MyStartup()

' run your initialisation code

' ...

DoCmd.OpenForm("frmStartup")

End Function

I prefer this because I would like to run some code before opening any
form. But basically it is a matter of taste which version you prefer.


HTH
Matthias Kläy
 
Yes, create a Macro called "AutoExec" and in the AutoExec macro under the
Action column select "RunCode" from the dropdown list. Then, in the
"Function Name" put in your function where you would like your code to start
at. ie: OpenApp()

Note: make sure you have () at the end.

Anytime a macro is named "AutoExec", Access will run this when the DB opens
normally (without holding down the Shift key when you start the DB).
 
Tony_VBACoder said:
Yes, create a Macro called "AutoExec" and in the AutoExec macro under
the Action column select "RunCode" from the dropdown list. Then, in
the "Function Name" put in your function where you would like your
code to start at. ie: OpenApp()

Note: make sure you have () at the end.

Anytime a macro is named "AutoExec", Access will run this when the DB
opens normally (without holding down the Shift key when you start the
DB).

But...if the user has specified a form to automatically be displayed in
Startup properties then the AutoExec macro will not be "the very earliest or
very first event detected when a DB is opened" which is what the OP asked
for. In those cases he would need to use the Open event of that form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top