View Full Version : Run Macro from VB at a specified time


JimLecocq
08-08-2007, 08:47 AM
Hello Everyone!

I hope I am doing this right I got in trouble the last time. Ha!

Well, Here is what I am looking for. I need to run a macro from VB when a Database is opened. I have the form set to the on open property and the macro runs when the form is opened. No problem. Well, it was but I figured that out.

Is there a code I can set in VB so that the macro only runs, with the On Open property set, when the database is opened at a specific time?


Thanks for anything you can give me.

pbaldy
08-08-2007, 08:56 AM
Probably, but I'm guessing a better solution would be to create a "utility" mdb that ran your macro when it opened, then closes itself. Then fire off that mdb from Scheduled Tasks at the desired time. That's what I do when I need something done at a particular time, and only want it done once.

JimLecocq
08-08-2007, 09:05 AM
Thanks for the input.

I take you to mean, I am still coming to speed on some term, to create a second database (Utility mdb) and run it.

pbaldy
08-08-2007, 09:11 AM
Correct; perhaps a copy of the main db with only the objects necessary to complete the task.