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

Email Filtered Report

Status
Not open for further replies.

sqlJunior

Technical User
Sep 22, 2002
123
TH
I have a problem trying to email a report from a form when using a filter.

I can preview the filtered report with the records filtered as the DoCmd.OpenReport accepts the strFilter as part of the Where clause see Case 2 below:

Select Case Me!grpFilterDrwgs
Case 1
DoCmd.OpenReport "RpDrwg", acViewPreview
Case 2
strFilter = "[PipeNo] = '" & Me!cboLineNo & "'"
DoCmd.OpenReport "RpDrwg", acViewPreview, , strFilter
End Select


It also works OK for printing. However, I can't find out hot to get the DoCmdSendObject to accept the strFilter. I can only send the complete report as in Case 1 below:

Select Case Me!grpFilterDrwgs
Case 1
DoCmd.SendObject acSendReport, "RpDrwg", acFormatSNP, , , , "Piping Drawing Data"
Case 2
strFilter = "[PipeNo] = '" & Me!cboLineNo & "'"
DoCmd.SendObject acSendReport, "RpDrwg", acFormatSNP, , , , "Piping Drawing Data"
End Select

Can anyone tell me how I can get Case 2 to accept the strFilter or is there any other way I can email the report with only the filtered data?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top