Solved

How to run macro automatically

Posted on 2011-09-07
17
651 Views
Last Modified: 2012-05-12
Hi
I have MS Access 2003 or 2010. I am running macro, which has about 5 queries.
It takes long time to run, sometimes 7 hours.
The macro name is “RunReport”
I would like to run the macro automatically, let say every Sunday at 17: 00 PM
What should I do?
0
Comment
Question by:rfedorov
  • 7
  • 7
  • 3
17 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 334 total points
ID: 36498761
create a .bat file and use Task Scheduler to set the schedule
0
 

Author Comment

by:rfedorov
ID: 36498787
thank you
i have never done it before, how?
0
 
LVL 16

Assisted Solution

by:Bryan Butler
Bryan Butler earned 166 total points
ID: 36498799
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 16

Expert Comment

by:Bryan Butler
ID: 36498801
Or do you need to know how to create a .bat?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498809
for A2003


open notepad and enter codes like this

@echo off
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" "C:\FolderName\DatabaseName.mdb" /Excl /X RunReport


save it with a .bat extension

open Task Scheduler

Control Panel > Admistrative Tools > Task Scheduler


follow the wizard



0
 

Author Comment

by:rfedorov
ID: 36498893
capricorn1: thank you
"C:\Documents and Settings\....mdb" /Excl /X RunReport
what is
/Excl /X RunReport
I am not sure about  /Excl /X  part
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498927
/Excl  '< to open the db in exclusive mode

 /X    ' run Macro

RunReport   ' < name of macro to run
0
 

Author Comment

by:rfedorov
ID: 36498957
Ok, two questions:
1.  the computer will be locked because it is weekend, how to wake it up
2. I need to use password to connect the database to the server, few tables from the database located on the server
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498975


pls don't try to find all the answer to your problems in one thread...

post another question/s...
0
 

Author Comment

by:rfedorov
ID: 36499006
capricorn1:
but this questions are part of the original question...
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36499126
leave your computer ON, while your Logged in...  
0
 

Author Comment

by:rfedorov
ID: 36499143
the computer lock itself every 15 minutes and  nobody can change the time, company policy...
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36499161
we dedicate a computer for this purposes, it just run without interruption...
0
 

Author Comment

by:rfedorov
ID: 36499190
So, it means it is impossible in my case
0
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 36499246
It can be done with Wake on LAN:

http://en.wikipedia.org/wiki/Wake-on-LAN
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 334 total points
ID: 36499401
rfedorov,

open your Task Scheduler
Add new task
in the window that will open, there are Tabs and options that you can select

try to investigate them..
you will find that there is an option
* to Wake computer,
* run whether user is logged on or not

* etc....
0
 

Author Comment

by:rfedorov
ID: 36499463
"C:\Documents and Settings\....mdb" /Excl /X RunReport
should be in "RunReport"
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question