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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run an event after a Report is open and showing

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I have several reports that I email. To mechanize this for my users I have installed an Email button on a Form. When the user clicks on the Email button the code checks the status of of the form and opens the correct report to be emailed. It then runs the File - Send To -Mail Recipient (as attachment).

This works well in a macro...but I want to change it to code. There seems to be a problem with the DoCmd.RunCommand acCmdSend code in that it shows the send dialog box without the report showing.

So, on Email click, I open the correct report and then the last statement is DoCmd.RunCommand acCmdSend. But the report does not show. Also, if I click cancel on the Send Dialog box I get a VB error on DoCmd.RunCommand acCmdSend. Is it waiting for something?

Is there a way I can ensure the report shows before using the send command?

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top