automatically send access reports.

R

Ron

Hi ,
I have conducted searches for this but could not find what I am looking for.
I am new to access and need help. I want to automatically send a report every
thursday at the same time. I do know how to use the scheduled tasks in
windows, but i do not know how to set up my database. I think I need to
create a macro that will open the file and then send the report and close it.
iIs this correct? When I do this it works and send the email, but it also
does the same thing when I open up the file. What am I doing wrong? Can
anyone help me with this? How is this attached to the report? Also, how do I
get the file to then close when the report is sent?
 
S

Steve Schapel

Ron,

It sounds like your report is being sent via the Autoexec macro. Move
this to another macro. Add the Quit action at the end of the macro, to
close the database after the report is sent. Then, the command line for
your task scheduler will be something along these lines...
"C:\PathToAccess\Msaccess.exe" "C:\PathToDB\MyDB.mdb" /x NameOfMacro
 
R

Ron

Steve,

Thanks for the information. I created another macro to send a report and
titled it MRB Update. I created a scheduled task. The scheduled task opens up
the database but does not send the report. What am I doing wrong? Here is my
path,
"K:\Quality System\QA Temp\F-0058 Non-Conforming Material Log.mdb" /x "MRB
Update"

Ron
 
D

Douglas J. Steele

You don't appear to have the full path to the Access executable,
msaccess.exe. While a shortcut that just includes an MDB file will open the
MDB, you cannot use any of the command line switches unless you include the
executable in the shortcut as well.
 
S

Steve Schapel

Ron,

As per my earlier reply, you should include the Msaccess.exe application
in your command line. Also note that the name of the macro does not
have ""s around it. I would rename the macro to something without a
space in the name. Let us know if that helps.
 
R

Ron

Steve,
Thanks for your help. I have tried different thing to get this to wrok. It
is probably something I am not doing. This is what I am doing, can you tell
form this if I am correct.

1: Create new macro that includes;
A: sendobject; Report, object name, etc.
B: Quit function
C: save macro as (sendreport)

Then I go and create a task.
The path for this is as follows;
"K:\Quality System\QA Temp\Gage Calibration\F-0008 CORRECTIVE & PREVENTIVE
ACTION LOG.mdb" / x"sendreport"

This is the complete database that I an using.

When the task starts, it opens the database, but does not run the macro. If
I save the macro as AutoExec, it works fine. The only thing is it runs every
time you open the file. If I click on the (sendreport) macro, it works fine,
just not with the sceduled task. Any information would be greatly
appreciated.

Thanks,
Ron
 
S

Steve Schapel

Ron,

I am afraid I can't think of a way of explaining it more clearly.
Please read my earlier posts, and the reply from Doug Steele.

1. Include the Msaccess.exe application in your command line.
2. Don't put ""s around the name of the macro.

The syntax for the command line is like this...
"C:\PathToAccess\Msaccess.exe" "C:\PathToDB\MyDB.mdb" /x NameOfMacro

In practice, this will look like this (depending on your Access
installation)...
"C:\Program Files\Microsoft Office\Office2003\OFFICE11\MSACCESS.exe"
"K:\Quality System\QA Temp\Gage Calibration\F-0008 CORRECTIVE &
PREVENTIVE ACTION LOG.mdb" /x sendreport
 
R

Ron

Steve,

Thank you for your help. I resolved the issue. I figured out the MSAccess
path and entered it into the task and works great.

Thanks you for your help,
Ron
 

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