Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

emailing a report

Status
Not open for further replies.

qbhome

Programmer
May 28, 2003
3
0
0
CA
I'm trying to email a report using the following code:
[DoCmd.SendObject acReport, "Report", "SnapshotFormat(*.snp)", "", "", "", "Todays Report", "", False, ""]

It works great as long as the database window is open, which is not true during runtime and that's when I get the error message: 'The command or action "OutputTo" isn't available now.'
Is there any way around this problem?
qb
 
I am assuming you are using Access 2000. There is actually a bug in 2000 with the SendObject command in VBA. You can get around this by using the SendObject in a macro. The error doesn't happen when using a macro.

Hope this helps.
 
Thanks for the response and sorry for not mentioning that I am using Access 2000.
However using a macro didn't work either as I was using a toolbar to perform the action. The great news for me is that since it worked for you I realized that I was missing something. So I used a form to run the action from. It turns out that either a macro or VB code works as long as a form or report is open!! Go figure!
Thanks again for your help,
qb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top