Database On Load event?

gblack

Registered User.
Local time
Today, 17:46
Joined
Sep 18, 2002
Messages
632
I am sure there’s probably an easy way to do this, but I just don’t know where I would write the code.

In the past, I have used the on load and on open events of a form to do X, Y, or Z… but now, what I would like to do is add a record into a table (with the users windows login ID), at the exact time the user opens the database. I don’t want to do this with a form… I just want a record written to a table immediately at the time the database opens.

My problem is that I don’t know where to do this. Is there such a thing as a database On Load or On Open Event? If so, where do I write the code for such a procedure?

Thanks,
Gary
 
Create a function to do the insert. Then, create a MACRO with the Command of RunCode and set the argument to the function name with the parentheses - myFunction()

Then save the macro as the name AutoExec

that will be the first thing that fires.
 
Thanks,
So the only way to do this is with an autoexec macro?

Seems odd that there wouldn't be a designated place to put this kind of code, just like there is for all the other events... or is the AutoExec macro designated place?

Anyway, Thanks again
-G
 
Thanks,
So the only way to do this is with an autoexec macro?

Seems odd that there wouldn't be a designated place to put this kind of code, just like there is for all the other events... or is the AutoExec macro designated place?

Anyway, Thanks again
-G

The AutoExec macro IS the designated place to run anything before any other things happen int the database. It has been that way forever.
 

Users who are viewing this thread

Back
Top Bottom