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!

Send Object Procedure

Status
Not open for further replies.

EdFleeson

Technical User
Mar 12, 2003
14
0
0
US
I am using a Event Procedure attached to a button on a form. When clicking on the button, the procedure will run. I want the procedure to send a report to certain email addresses. I am using the Docmd.sendobject to do this. Two questions:

1) when you use the command Openreport, you have the ability to put a Where condition on the report to limit the records in the report. Is there a way to do this when using the SendObject command.

2) If I want to send the report as a Snapshot document, what is the Output format (example it I were to do this as an excel spreadsheet it would be acFormatXLS.

thanks in advance
 
Q2)

DoCmd.SendObject acSendReport, "rptXYZ", "Snapshot Format"

works fine.

OR you can use

DoCmd.SendObject acSendReport, "rptXYZ", acFormatSNP


As for Q1)

The Where Condition string goes after the third comma




'ope-that-'elps.





G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Thanks. The Snap part works. Perhaps I didn't place the quotes around Snapshot Format. Using acFormatSNP I get a error.

On Q1, isn't the "To" condition after the 3rd comma? (Here is my command so far:

dptsel = DLookup("", "email address", "[depot]=" & myplant & "")
mailto = dptsel

DoCmd.SendObject acSendReport, "Load Sheet_Header", "Snapshot Format", mailto, , , "Load Sheets", , False
 
Q1)
Well If I was to address myself to the question you ACTUALLY asked - rather than the one I imagined .. ..

Sorry about that.

Try This
Put the Where clause string into a text box control on a form somewhere and then in the Report's Open Event use that string to modify it's own RecordSource property.

If you can't guarantee to have a specific form open every time the report opens then you might decide to use a Global String variable instead.



'ope-that-'elps.



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top