473,503 Members | 241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6837
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4935
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
2
4445
by: Marc Shapiro | last post by:
I am relatively new to python (I have used it on and off for a few small projects over the last few years) so I imagine that what I am trying to do has already been done, but practical experience,...
11
2079
by: Dave | last post by:
Hello NG, If a particular dynamic library gets loaded, I need to ensure that a function in that library gets executed on startup (and I want the mechanism to use only Standard C++). Here's what...
4
2925
by: wongjoekmeu | last post by:
Hello All, >From a book where I have learned C++ it says that each application must have at least one function which is the main() function. Now I have the source code of a C++ program from...
9
9337
by: PyPK | last post by:
Hi if I have a function called tmp=0 def execute(): tmp = tmp+1 return tmp also I have def func1(): execute() ....
7
6797
by: SueB | last post by:
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...
2
2527
by: Jack | last post by:
I have a chunk of code that loads a few dozen function pointers into global variables. I'm concerned with unused memory consumption. What if the client only needs to use one or two functions? Then...
0
1054
by: Brian | last post by:
I'm using Server.Execute to decide at run-time which .aspx page to use to format a mail message. Using a StringWriter, I call Server.Execute on the page that does the formatting, then snag the text...
1
3562
by: =?Utf-8?B?S2Vubnk=?= | last post by:
I have one bat file that contains a command to startup Java Program. Then, I would like to create a cluster job to call the bat file. In case of one computer is down, another computer can also call...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.