Import Timed

D

danka

Hello:

I have written a VBA procedures which imports and processes data.

I would like to run it daily at the fixed time, eg. 10:00 am. every day.
I would like to run it without user iintervention. Is is possible to do so?

Thanks
 
K

Klatuu

One method, depending on what version of Windows you are using, would be to
use the task scheduler to launch an mdb that would use its starup function to
do this. It should be a separate mdb from the one your users work with.
 
D

danka

Thanks. I have never used Task Scheduler and I am readig about this tool -
I will be running the application from Windows 2003 Server, clients Windows
XP.

As a startup function, should I create an autoexec macro. Currently, I
created on click event sub procedure that imports text and runs several
update queries. My question is how would I call the sub from the startup?

Thanks.
 
K

Klatuu

The Autoexec macro will allow a function but not a sub. You could change
your sub to a function or call your sub from a function.
On the other hand, If you want a form presented to the user, you could
identify the form in the Startup Display Form/Page option and have the code
run from there.
 
D

danka

Hello:

Thanks for all the suggestions. What I believe (subject to test) is that I
could start the mdb file from the Task Scheduler. Database would start and
the autoexec would run code and the sub would be called from there. The sub
would execute (import and update files) and then would execute DoCmd.quit).
Could this possibly work?
 
K

Klatuu

Yes. The DoCmd.Quit would need to be in your code. And remember, the
Autoexec macro can only run a function, so you will need to either rewrite
your function to a sub or just call your sub from a function:
Function StartDownLoad() As Boolean
Call MyDownLoadSubName
DoCmd.Quit
End Function
 
D

danka

Thanks so much - I implemented my new application this week and the
procedures is invoked by the user. Now, as the next step towards automation
I will re-write the procedure and try to use the solutions that you are
suggesting.

Will let you know if this worked ok.
 
Top