D
dlazenby
I am trying to print a report that consists of a single record. The command
button is on the form where the single record is generated.
I went to the MS KB and found article ACC2000. The code is:
Private Sub cmdPrintRecord_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "rptPrintRecord"
strCriteria = "[CustomerID]='" & Me![CustomerID] & "'"
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub
My report name is PatientRpt.
My primary key for the table (PatientTbl) is PtIDpk.
I substituted PatientRpt for rptPrintRecord and PtIDpk for CustomerID.
However, when I go to the form, click the button I receive an error message:
"Run-time error '3464':
Data type mismatch in criteria expression."
Please advise
button is on the form where the single record is generated.
I went to the MS KB and found article ACC2000. The code is:
Private Sub cmdPrintRecord_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "rptPrintRecord"
strCriteria = "[CustomerID]='" & Me![CustomerID] & "'"
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub
My report name is PatientRpt.
My primary key for the table (PatientTbl) is PtIDpk.
I substituted PatientRpt for rptPrintRecord and PtIDpk for CustomerID.
However, when I go to the form, click the button I receive an error message:
"Run-time error '3464':
Data type mismatch in criteria expression."
Please advise