Hi, I found the answer to my question on EE, but when I tried it, it doesn't work. Maybe it's because I'm using Access 2010 and the answer was for Access 2007?
Using VBA, how do I create a PDF from a report and send it a filter.
The Code I'm using:
Dim strReport As String
Dim VarGroup As String
VarGroup = "CMD20032"
strReport = "rpt_PB1"
DoCmd.OpenReport strReport, acViewPreview, , "[Group Number]=" & VarGroup, acHidden
DoCmd.OutputTo acOutputReport, strReport, acFormatPDF, filename, False
DoCmd.Close acReport, strReport
It prompts me to enter a parameter with "CMD20032" as the Parameter name.
What am I doing wrong? The report has the field "Group Number" on it.