SendObject does not have a WhereCondition like OpenReport.
As a workaround, you can pass the filter via a public string variable, and
apply it in Report_Open event.
1. In a standard module (Modules tab of Database Window), in the General
Declarations section (top, with the Option statements), enter:
Public gstrReportFilter As String
2. In the code that calls SendObject:
gstrReportFilter = "[tblPI]![Pri_responsible] = """ & _
[Forms]![frmReports]![txtRptTransfer] & """"
3. In the Open event of the report:
If Len(gstrReportFilter) > 0 Then
Me.Filter = gstrReportFilter
Me.FilterOn = True
gstrReportFilter = vbNullString
End If
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
JAdams said:
Is there a way to add criteria for the report in docmd.sendobject?
I need to add:
stCriteria = "[tblPI]![Pri_responsible] = """ &
[Forms]![frmReports]![txtRptTransfer] & """"
To:
DoCmd.SendObject acReport, stDocName, "Snapshot Format",
[lstReport].[Column](1)
Thanks in advance!!