I had a button that printed a report and in the VBA code it filtered the record to the customer that was active on the current form.
Dim stDocName, strWhere As String
strWhere = "DMPClientID=" & Me!DMPClientID
stDocName = "rptDMPFinancialStatementB
DoCmd.OpenReport stDocName, acPreview, , strWhere
I now have found (withh EE help) a module and code that coverts the report into a PDF
It works fine however the filter i use (ABOVE) is not working and when i use the code below it opens 40,000 pages and converts all of them instead of the 1 page filtered to the client ID
What can i add to the code below to filter it as the code above does?
Private Sub cmdReport2PDFSecurity_Click()
Dim blRet As Boolean
Dim tr As Long
tr = rsModify
tr = tr Or rsPrint
tr = tr Or rsCopyObj
blRet = ConvertReportToPDF(Me.lstRptName, vbNullString, _
Me.lstRptName.Value & ".pdf", False, True, 150, "ABC", "DEF", tr, 0)