Solved

How to run macro automatically

Posted on 2011-09-07
17
633 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 119

Accepted Solution

by:
Rey Obrero 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
 
LVL 16

Expert Comment

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

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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 119

Assisted Solution

by:Rey Obrero
Rey Obrero 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now