Automate Macro

F

franklinbukoski

I'd like to automate a macro to run without me having to tell it to...in
other words, every Monday I'd like a report to automatically be emailed to
recipients.

I already have a macro that I can run to do this, now I'd like the report to
run itself to save even more time.

Any thoughts???
 
G

Graham Mandeno

Hi Franklin

If the database is opened by someone every day, then you could run some code
attached to AutoExec which:
1) checks that today is a Monday and that the report has not yet been
printed
2) prints the report
3) updates a field in a table with the date that the report was last printed

If you want to make it completely unattended, you can use the Windows Task
Scheduler:

The Access command line allows you to specify the name of a macro that will
run when the database is opened. Set the target for the sheduled task to:

"<path to msaccess.exe" "path to your mdb" /X macPrintMondayReport

Remember to include a Quit action in your macro so the database is not left
open.
 
F

franklinbukoski

Thank you for the response, I think you've outlined just what I'm looking
for, unfortunately, I don't know how to do this.

Where is the Windows Task Scheduler located? Is autoexec a macro option
(access didn't recognize it when I typed it in the macro action field), or
VBA? Does Windows Task Scheduler provide an option for time of day?

Our database is opened and closed repeatedly throughout the day and I'd only
want the report sent out once.

I appreciate any further feedback you could provide, I've just learned how
to run queries, macros are completely new and VBA WAYYY over my head.

Cheers.

Graham Mandeno said:
Hi Franklin

If the database is opened by someone every day, then you could run some code
attached to AutoExec which:
1) checks that today is a Monday and that the report has not yet been
printed
2) prints the report
3) updates a field in a table with the date that the report was last printed

If you want to make it completely unattended, you can use the Windows Task
Scheduler:

The Access command line allows you to specify the name of a macro that will
run when the database is opened. Set the target for the sheduled task to:

"<path to msaccess.exe" "path to your mdb" /X macPrintMondayReport

Remember to include a Quit action in your macro so the database is not left
open.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

franklinbukoski said:
I'd like to automate a macro to run without me having to tell it to...in
other words, every Monday I'd like a report to automatically be emailed to
recipients.

I already have a macro that I can run to do this, now I'd like the report
to
run itself to save even more time.

Any thoughts???
 
C

Carol Grismore

http://www.iopus.com/guides/winscheduler.htm
--
Carol


franklinbukoski said:
Thank you for the response, I think you've outlined just what I'm looking
for, unfortunately, I don't know how to do this.

Where is the Windows Task Scheduler located? Is autoexec a macro option
(access didn't recognize it when I typed it in the macro action field), or
VBA? Does Windows Task Scheduler provide an option for time of day?

Our database is opened and closed repeatedly throughout the day and I'd only
want the report sent out once.

I appreciate any further feedback you could provide, I've just learned how
to run queries, macros are completely new and VBA WAYYY over my head.

Cheers.

Graham Mandeno said:
Hi Franklin

If the database is opened by someone every day, then you could run some code
attached to AutoExec which:
1) checks that today is a Monday and that the report has not yet been
printed
2) prints the report
3) updates a field in a table with the date that the report was last printed

If you want to make it completely unattended, you can use the Windows Task
Scheduler:

The Access command line allows you to specify the name of a macro that will
run when the database is opened. Set the target for the sheduled task to:

"<path to msaccess.exe" "path to your mdb" /X macPrintMondayReport

Remember to include a Quit action in your macro so the database is not left
open.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

franklinbukoski said:
I'd like to automate a macro to run without me having to tell it to...in
other words, every Monday I'd like a report to automatically be emailed to
recipients.

I already have a macro that I can run to do this, now I'd like the report
to
run itself to save even more time.

Any thoughts???
 
F

franklinbukoski

Thank you both very much, I've got the task scheduler working now, my next
obstacle is that the database is password protected, is there a command I can
give the task manager to input the password and click the ok button so entry
into the database can be gained?

Carol Grismore said:
http://www.iopus.com/guides/winscheduler.htm
--
Carol


franklinbukoski said:
Thank you for the response, I think you've outlined just what I'm looking
for, unfortunately, I don't know how to do this.

Where is the Windows Task Scheduler located? Is autoexec a macro option
(access didn't recognize it when I typed it in the macro action field), or
VBA? Does Windows Task Scheduler provide an option for time of day?

Our database is opened and closed repeatedly throughout the day and I'd only
want the report sent out once.

I appreciate any further feedback you could provide, I've just learned how
to run queries, macros are completely new and VBA WAYYY over my head.

Cheers.

Graham Mandeno said:
Hi Franklin

If the database is opened by someone every day, then you could run some code
attached to AutoExec which:
1) checks that today is a Monday and that the report has not yet been
printed
2) prints the report
3) updates a field in a table with the date that the report was last printed

If you want to make it completely unattended, you can use the Windows Task
Scheduler:

The Access command line allows you to specify the name of a macro that will
run when the database is opened. Set the target for the sheduled task to:

"<path to msaccess.exe" "path to your mdb" /X macPrintMondayReport

Remember to include a Quit action in your macro so the database is not left
open.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

message I'd like to automate a macro to run without me having to tell it to...in
other words, every Monday I'd like a report to automatically be emailed to
recipients.

I already have a macro that I can run to do this, now I'd like the report
to
run itself to save even more time.

Any thoughts???
 
R

Rick Brandt

franklinbukoski said:
Thank you both very much, I've got the task scheduler working now, my
next obstacle is that the database is password protected, is there a
command I can give the task manager to input the password and click
the ok button so entry into the database can be gained?

You can pass user names and passwords for User Level Security as arguments when
you open an MDB, but the same cannot be done for the simpler file password. My
advice would be to eliminate it as it is so easy to hack as to be useless
anyway.
 
Top