D
Don
I have a form with a button that should allow me to print a report for only
the record on the form with the corresponding link criteria. in the On Click
Event Procedure I have the following code:
Private Sub Print_Audit_Report_Click()
On Error GoTo Err_Print_Audit_Report_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Audit Open Projects"
stLinkCriteria = "[CDCNum]=" & Me![Project Name]
'On Both Form and Report the property name is Project Name and Control
Source is CDCNum
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_Print_Audit_Report_Click:
Exit Sub
Err_Print_Audit_Report_Click:
MsgBox Err.Description
Resume Exit_Print_Audit_Report_Click
End Sub
What happens when I try to execute the code is a window pops-up telling me
"Enter Parameter Value". I then enter A12345 (the CDCNum and Project Name)
and the correct record is printed in the report. Any suggestions on what is
going wrong?
Thanks,
Dennis
the record on the form with the corresponding link criteria. in the On Click
Event Procedure I have the following code:
Private Sub Print_Audit_Report_Click()
On Error GoTo Err_Print_Audit_Report_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Audit Open Projects"
stLinkCriteria = "[CDCNum]=" & Me![Project Name]
'On Both Form and Report the property name is Project Name and Control
Source is CDCNum
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_Print_Audit_Report_Click:
Exit Sub
Err_Print_Audit_Report_Click:
MsgBox Err.Description
Resume Exit_Print_Audit_Report_Click
End Sub
What happens when I try to execute the code is a window pops-up telling me
"Enter Parameter Value". I then enter A12345 (the CDCNum and Project Name)
and the correct record is printed in the report. Any suggestions on what is
going wrong?
Thanks,
Dennis