Auto Running a module !?

uk

Board Regular
Joined
Nov 4, 2003
Messages
101
I am trying to automate my access database to run first thing in the morning so it is has finished running by the time I get to work, I have set up a module -modRUN that runs all the queries and updates all the tables, the only problem is getting this module to run at the time I want.

I have figured two possible ways to do this, either

1] Create another module that will prompt the modRun to run at a certain time- I have no idea how to do this!

2] To use the Shedule task wizard - but this will only open the databse, it wont get the module to run!

Anybody got a solution?[/b]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
2] To use the Shedule task wizard - but this will only open the databse, it wont get the module to run!

You are on the right track and are very close! I have done something like this, using method 2 you described above. Here are the key steps you are missing that will allow you to do it:

1. Set up your database to open a form automatically upon start-up.. Do this by going to Tools | Startup and select your form under the Display Form/Page textbox.

2. Call your macro in the Form_Load event of the form you are opening upon start-up.

Now, when the database is opened, it will automatically open the form you specified, and the Form_Load event will automatically call and run your code.
 
Upvote 0
Hullo. Alternately, you can modify the line to launch the database used in your Scheduled job, to run a given macro, by putting /X MacroName at the end.

HTH (y)

P
 
Upvote 0
Hullo. Alternately, you can modify the line to launch the database used in your Scheduled job, to run a given macro, by putting /X MacroName at the end.

Philem, that's cool, I didn't know that. Does that just work with Macros, or can you call VBA code (Sub procedures stored in Modules) also?
 
Upvote 0
Apparently our IT Dep have decided not to allow us to use task shceduler !!!

Any one have a work around idea?


1] Create another module that will prompt the modRun to run at a certain time- I have no idea how to do this!
 
Upvote 0
you can use the timer event of a form to run your code for you. Check out "Event Timer" in help

Peter
 
Upvote 0
To run code at the startup of the database, you can also use a macro titled "AutoExec" . Within this macro you can place any number of arguments (Open Form, RunCode, RunSQl,etc.)

HTH,
CT
 
Upvote 0

Forum statistics

Threads
1,214,891
Messages
6,122,101
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top