B
BruceM
Not sure if this is a form question or a report question or something else.
A couple of weeks ago I set up Lebans' Report to PDF, and it worked in a
test copy, but then I had to make some other changes to the database in a
bit of a hurry, so I left the test copy aside and made the other changes. I
added the Report to PDF modules, and used the same code as before in a
command button on the form. strPath is a hard-coded path to a network
folder and a file name based on the purchase order number. I left out the
details, but it is a legitimate path and file name.
Dim blnRet As Boolean
Dim strFileName As String
' Call the convert function
blnRet = ConvertReportToPDF("rptPO", , strFileName)
This is the place in the conversion module where the code gets tripped up
with error 3464, data type mismatch in criteria expression:
' Export the selected Report to SnapShot format
DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)", _
strPathandFileName
I tried it with just the basics:
DoCmd.OutputTo acOutputReport, "rptPO"
When I do it that way I am prompted for the format and for the output file
name. The same error occurs.
I have included only the problem line of code from the module, thinking that
it may not be necessary to post the whole thing. I expect a number of
people are familiar with the code, for one thing; for another, it seems the
problem may be with the information being received by OutuptTo, so perhaps
somebody has some ideas of what to look for.
The report is based on a filtered query (limited to the current record
only). I plan to change this so that the report's record source is a single
record loaded at run time (the Open event, I expect), but either way I
wonder if the problem is related to the PDF code not knowing which record to
use. I can't sort out from the code just how that works. The puzzling
thing is that it worked before, so it is probably a minor issue I am not
seeing.
A couple of weeks ago I set up Lebans' Report to PDF, and it worked in a
test copy, but then I had to make some other changes to the database in a
bit of a hurry, so I left the test copy aside and made the other changes. I
added the Report to PDF modules, and used the same code as before in a
command button on the form. strPath is a hard-coded path to a network
folder and a file name based on the purchase order number. I left out the
details, but it is a legitimate path and file name.
Dim blnRet As Boolean
Dim strFileName As String
' Call the convert function
blnRet = ConvertReportToPDF("rptPO", , strFileName)
This is the place in the conversion module where the code gets tripped up
with error 3464, data type mismatch in criteria expression:
' Export the selected Report to SnapShot format
DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)", _
strPathandFileName
I tried it with just the basics:
DoCmd.OutputTo acOutputReport, "rptPO"
When I do it that way I am prompted for the format and for the output file
name. The same error occurs.
I have included only the problem line of code from the module, thinking that
it may not be necessary to post the whole thing. I expect a number of
people are familiar with the code, for one thing; for another, it seems the
problem may be with the information being received by OutuptTo, so perhaps
somebody has some ideas of what to look for.
The report is based on a filtered query (limited to the current record
only). I plan to change this so that the report's record source is a single
record loaded at run time (the Open event, I expect), but either way I
wonder if the problem is related to the PDF code not knowing which record to
use. I can't sort out from the code just how that works. The puzzling
thing is that it worked before, so it is probably a minor issue I am not
seeing.