Can I schedule a Module?

G

Guest

I know how to schedule a Macro through Window's Scheduler. I wasn't able to
accomplish the task I needed to this time around using a Macro, so I had to
convert my Macro to a Module (VBA) and adapt from there. Now that I have it
working, I am needing a way to schedule this so that it can happen without
someone having to remember to go run it each day. Is this possible?
 
T

Terry

One way is to have the scheduler open the database, that run the autoexec
macro, that opens a form, that calls your module in it's OnTimer event. You
could even have the database close after the module code has finished. If
you don't want the form to show, open it hidden.
Regards
 
T

Tim Ferguson

Now that I have it
working, I am needing a way to schedule this so that it can happen
without someone having to remember to go run it each day. Is this
possible?

Use the scheduler to call access with the database and the /m switch:

c:\bin\msaccess.exe h:\data\mymbd.mbd /m themacrotorun


More details in the help files under Command Line Switches

If you are just updating data, using SQL etc, then it's probably easier to
do the whole lot with a VBScript routine accessing the Jet database
directly without calling Access at all. IFYSIM.


All the best


Tim F
 
G

Guest

Tim -
I hadn't heard of the /m switch, thank you. I was using the /x switch in the
Scheduler for my Macro's that I have scheduled.
I tried the /m however with the name of the Module and that seems to also
want to call a macro rather than the module. I checked the help files for
"Command line switches" and didn't see the /m listed there.
Here is my question now... The macro was called "Cases Closed Comments".
When I had Access convert this to VB/a Module, it renamed it "Converted
Macro- Cases Closed Comments1"

I could post the module code if that helps? Was one of your suggestions that
I could include code right in there to schedule this?

Thank you for your help!
 
G

Guest

I got it figured out!
I created a Macro to call the Module that I had created from the Macro...
hahaha...

The Macro is set up with only "RunCode" and that calls the function from my
Module.
I then scheduled through Windows Scheduler.
All set now!
Thanks
 
T

Tim Ferguson

The Macro is set up with only "RunCode" and that calls the function
from my Module.

This is standard I'm afraid. Nearly all my apps start with a two-line
Autoexec macro that calls a Window Hide (the database window) and then
RunCode (whatever I really want to happen).

I don't know why the Access team chickened out of putting VBA at the
forefront of the Access app. It's a bit like Excel burying the logical and
neat R1C1 notation behind the A1 mess they inherited from Lotus.

Can't have everything, I guess. :)

All the best


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top