automatically send access reports.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Hi Ron,
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?

Did you use a macro named Autoexec? If so, rename the macro (or move the
applicable actions to another named macro). You can either use the same macro
group, or create a new macro group (ie. macro that is shown in the database
window). If you'd like to create a separate macro within the Autoexec macro
group, then click on View > Macro Names in design view, and assign a new name
on the action line.

To run your macro from the task scheduler, create a new shortcut that
includes the full path to msaccess.exe, the full path to your database and
the /x MacroName switch. This goes into one line in the target. The maximum
target length is 256 characters. For example:

"Path to MSACCESS.EXE" "Path to database file" /x "NameOfMacro"

Note that each string is enclosed in quotes, and separated by spaces. These
quotes and spaces are counted as part of the 256 character limit.
How is this attached to the report?
I don't really understand this question...
Also, how do I get the file to then close when the report is sent?
Add a Quit action with Exit as the option specified in the lower window.

If you are willing to try a VBA code method, you can likely achieve the same
task without opening the database (I think).

Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

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.
Is 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?
 
Tom,
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
 
Hi Ron,

You indicated in your initial message that things worked okay, as far as
sending the e-mail based on a scheduled task, except that it did the same
thing when you just opened your database. You also indicated macros, is what
led me to believe that you might have placed these commands as actions into
an Autoexec macro. Is this correct?

I tend to avoid using macros myself, with the exception of Autoexec and
Autokeys, but I suspect that you may have omitted an action line in your new
MRB Update macro that causes the report to be sent. If you open your database
normally, and run this new macro, does it do everything that you expect it to
do? Note that for testing purposes, you might want to add a new (temporary)
macroname for the last line: Quit action with Exit as the option specified in
the lower window. Once you get this macro to work properly when run with
Access already opened, then your next task is to try to get it to work
properly when Access starts out closed, and you double-click on your shortcut
that includes the switch to run this macro (ie. /x "MRB Update").

My guess, without seeing your database, is that your original macro included
a SendObject action that you have not moved to the new macro. Another
possibility is that some additional code and/or macros are being run via a
Startup form defined under Tools > Startup. Without testing, I believe such a
form would not be started via a shortcut with a command line that included /x
"MRB Update".

I'm a little curious as to how you had this working before (?), to send
e-mail automatically, if you are using either Outlook or Outlook Express.
These two e-mail clients have been disabled in Office patches released in
past years, as far as automatically sending e-mail. Perhaps you are using a
different e-mail program that is unaffected by these patches?

Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

Tom,
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
__________________________________________

:

c
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?

Did you use a macro named Autoexec? If so, rename the macro (or move the
applicable actions to another named macro). You can either use the same macro
group, or create a new macro group (ie. macro that is shown in the database
window). If you'd like to create a separate macro within the Autoexec macro
group, then click on View > Macro Names in design view, and assign a new name
on the action line.

To run your macro from the task scheduler, create a new shortcut that
includes the full path to msaccess.exe, the full path to your database and
the /x MacroName switch. This goes into one line in the target. The maximum
target length is 256 characters. For example:

"Path to MSACCESS.EXE" "Path to database file" /x "NameOfMacro"

Note that each string is enclosed in quotes, and separated by spaces. These
quotes and spaces are counted as part of the 256 character limit.
How is this attached to the report?
I don't really understand this question...
Also, how do I get the file to then close when the report is sent?
Add a Quit action with Exit as the option specified in the lower window.

If you are willing to try a VBA code method, you can likely achieve the same
task without opening the database (I think).

Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

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.
Is 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?
 

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

Back
Top