Auto Run Report each Month

S

Stacey Crowhurst

Is there a way to make access run a particular report
(rptWarrantyLatentDefects) monthly? Or does access have an auto reminder
function? Ideally, when I open the database for the first time each month it
will automatically run the report. I'm not sure if this is possible.

Thanks,
Stacey
 
S

Steve Schapel

Stacey,

You need to have a way of knowing whether this month's printing has been
done yet. The easiest way is to make a table with a single text field to
record LastPrintMonth. Then, in your macro, you can put a Condition like
this:
DLookUp("[LastPrintMonth]","PrintLog")<Format(Date(),"yyyymm")
Then, to complete the cycle, as well as the OpenReport action, add an
OpenQuery action to the macro to run an update query to update the
LastPrintMonth field in the PrintLog table to Format(Date(),"yyyymm")

Hope that makes sense.

The other way to do it is use Windows Task Manager to make a scheduled task
to run the macro every month.
 
S

Stacey Crowhurst

Ok, I got most of it! I have the table, query and macro all working. Two
follow up questions though. (1) How do I suppress the pop up box that keeps
telling me I am going to update rows? and (2) how do I tell Access to run it
for me each month?

Thanks!
Stacey

Steve Schapel said:
Stacey,

You need to have a way of knowing whether this month's printing has been
done yet. The easiest way is to make a table with a single text field to
record LastPrintMonth. Then, in your macro, you can put a Condition like
this:
DLookUp("[LastPrintMonth]","PrintLog")<Format(Date(),"yyyymm")
Then, to complete the cycle, as well as the OpenReport action, add an
OpenQuery action to the macro to run an update query to update the
LastPrintMonth field in the PrintLog table to Format(Date(),"yyyymm")

Hope that makes sense.

The other way to do it is use Windows Task Manager to make a scheduled task
to run the macro every month.

--

Steve Schapel, Microsoft Access MVP


Stacey Crowhurst said:
Is there a way to make access run a particular report
(rptWarrantyLatentDefects) monthly? Or does access have an auto reminder
function? Ideally, when I open the database for the first time each month
it
will automatically run the report. I'm not sure if this is possible.

Thanks,
Stacey
 
S

Steve Schapel

Stacey,

(1) Put in a SetWarnings/No action before the OpenQuery action.
(2) That's the whole point of the Condition. The macro will only run if the
LastPrintMonth is last month, i.e. this will be true the first time you open
the database for the month, and thenfor the rest of the month (because the
LastPrintMonth has been updated), the Condition will be false, and therefore
the macro will be ignored.
 
S

Stacey Crowhurst

Great, thanks Steve. I fixed the warnings. And I'll be able to test the
condition on Wendesday to make sure I typed everything in correctly!

Thanks again,
Stacey
 
S

Steve Schapel

Stacey,

Just in case you're not all that familiar with macro Conditions, if the
Condition applies to more than one action in the macro (which it does in
your case - it applies to all of them, you don't want the macro to be
triggered at all if the Condition is not met), then you write the Condition
expression for the forst action, and then enter an ellipsis (i.e. 3 dots
.... ) in the Condition for the subsequent actions.
 

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