ReportToPDF

  • Thread starter Thread starter johnlute
  • Start date Start date
J

johnlute

I'm having real trouble with the following:

blRet = ConvertReportToPDF("rptComplaints", vbNullString, _
"rptComplaints", Value & ".pdf", False, True, 150, "", "", 0, 0, 0)

The debugger highlights "ConvertReportToPDF" and states Compile error:
wrong number of arguments or invalid property assignment.

I've tinkered every which way and it only gets worse. Anyone have an
idea?

Thanks!!!
 
There are only 11 arguments for the sub, but you have 12 arguments.

You added a comma between the "OutputPDFname" and the extension. You should
not have "Value" because you are hard coding the PDF name. The "Value" is
part of the example - the filename was being picked from a list control (NOTE
that "Value" is not needed - it is the default property).

So you should be using:

blRet = ConvertReportToPDF("rptComplaints", vbNullString, _
"rptComplaints.pdf", False, True, 150, "", "", 0, 0, 0)


Note that the arguments are optional. So you could use:


blRet = ConvertReportToPDF("rptComplaints", vbNullString,
"rptComplaints.pdf", False, True, 150)


HTH
 
Back
Top