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!

SendObject Report parameters

Status
Not open for further replies.

JKDeveloper0718

Programmer
Aug 11, 2006
23
US
The latest request is for the user to be able to email a report via snapshotviewer format. My main issue is the fact that the report needs to be emailed with the proper filter. In my investigation of this element I came across sendobject which seemed like a nice function. So My question is how can I pass report parameters such as where conditions within the sendobject function. Here is the following example:

Report: rptDemo
Where Condition: [StartDate]=#12/12/2007# And [EndDate]=#12/31/2007#

docmd.SendObject acSendReport, "rptDemo", acFormatSNP, "jj@net.com"

Anyways any help with report paramters in the Sendobject element would be great.
 
Either add the filter into the Report's Recordsource, or open the report in Preview mode first (using the filter) and then have a toolbar where the user Prints, Sends, Saves or Closes. The latter is what I do.

If you mean a "date range", i.e. you have a date field in your table and the user indicates a date range to show -

so typically you have a form that you launch reports from. It has two text boxes (txtStartDate and txtEndDate). The user fills in two dates and hits a button:

docmd.openreport "Report1",acViewPreview,,"OrderDate between #" & Me.txtStartDate & "# and #" & Me.txtEndDate & "#"

This will open your report in preview mode. Then I have a custom toolbar that shows SAVE, SEND, PRINT, CLOSE.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top