469,953 Members | 2,403 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,953 developers. It's quick & easy.

Execute function at db startup - how?

Hi. I want to execute a routine, at database startup time, to relink the
backend tables. I have the code for the function, but I don't know where
to invoke it. I tried putting a call to the function in the Open Event
of the MainMenu (which gets displayed at Startup). That seems to
be too late, because I get an error that says that it can't find the
tables (I moved the backend file to a different folder, for testing of
this function).

What event is "kicked off" when the database starts up?
Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
5 6675
Create a macro called

AutoExec

and then have it use the RunCode action to call your function.

Nov 13 '05 #2
SueB wrote:
Hi. I want to execute a routine, at database startup time, to relink the
backend tables. I have the code for the function, but I don't know where
to invoke it. I tried putting a call to the function in the Open Event
of the MainMenu (which gets displayed at Startup). That seems to
be too late, because I get an error that says that it can't find the
tables (I moved the backend file to a different folder, for testing of
this function).

What event is "kicked off" when the database starts up?
Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***


You can create an autoexec macro that will run when you open the
database. Search for more help with autoexecs.

I don't see why your main form can't find the files in the OnOpen event
unless it is bound to tables. If it is unbound, I should think you
could call the function there.

If you use an autoexec, you'd first RunCode the function and then open
the main form.

Nov 13 '05 #3
Gord,
Thank you. That will do it.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #4
Salad,

Thanks for your suggestions. That will work. As for why the Main Menu
is not getting opened before the "can't find the table" error, I split
the database and kept the Switchboard table in the backend file. The
Main Menu screen needs the Switchboard table. Thus ... error.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #5
"SueB" wrote
. . . As for why the Main Menu
is not getting opened before the "can't
find the table" error, I split the database
and kept the Switchboard table in the
backend file. The Main Menu screen
needs the Switchboard table. Thus ... error.

"Ditch the switch" It is a complex solution to a simple problem, and, in
every case I have seen, can easily be replaced with a Switchboard made just
with Forms using Command Buttons and other standard Controls, with no
tables needed.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Penn Markham | last post: by
2 posts views Thread by Marc Shapiro | last post: by
11 posts views Thread by Dave | last post: by
4 posts views Thread by wongjoekmeu | last post: by
9 posts views Thread by PyPK | last post: by
2 posts views Thread by Jack | last post: by
reply views Thread by Brian | last post: by
1 post views Thread by =?Utf-8?B?S2Vubnk=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.