E
Emma
I have the following code in the OnClick Event of a
command button and cannot get it to print only the report
for the current record. Can someone tell me where I have
gone awry?
Private Sub Print_Sponsorship_Consulting_Request_Click()
On Error GoTo
Err_Print_Sponsorship_Consulting_Request_Click
Dim stDocName As String, strLinkCriteria As String
'if Request Type is 1 then print the current record
Sponsorship Form
If Request_Type_Frame = 1 Then
stDocName = "Rpt_Sponsorship_Request"
'select only the current form accounting reference number
to the report accounting reference no.
strLinkCriteria = "Reports!
Rpt_Sponsorship_Request![Accounting_Reference_No] = Forms!
Frm_Request![Accounting_Reference_No]"
DoCmd.OpenReport stDocName, acPreview
Else
'if Request Type is 2 then print the current record
Consulting Form
If Request_Type_Frame = 2 Then
stDocName = "Rpt_Consulting_Request"
'select only the current form accounting reference number
to the report accounting reference no.
strLinkCriteria = "Reports!
Rpt_Consulting_Request![Accounting_Reference_No] = Forms!
Frm_Request![Accounting_Reference_No]"
DoCmd.OpenReport stDocName, acPreview
End If
End If
Thanks!
Emma
command button and cannot get it to print only the report
for the current record. Can someone tell me where I have
gone awry?
Private Sub Print_Sponsorship_Consulting_Request_Click()
On Error GoTo
Err_Print_Sponsorship_Consulting_Request_Click
Dim stDocName As String, strLinkCriteria As String
'if Request Type is 1 then print the current record
Sponsorship Form
If Request_Type_Frame = 1 Then
stDocName = "Rpt_Sponsorship_Request"
'select only the current form accounting reference number
to the report accounting reference no.
strLinkCriteria = "Reports!
Rpt_Sponsorship_Request![Accounting_Reference_No] = Forms!
Frm_Request![Accounting_Reference_No]"
DoCmd.OpenReport stDocName, acPreview
Else
'if Request Type is 2 then print the current record
Consulting Form
If Request_Type_Frame = 2 Then
stDocName = "Rpt_Consulting_Request"
'select only the current form accounting reference number
to the report accounting reference no.
strLinkCriteria = "Reports!
Rpt_Consulting_Request![Accounting_Reference_No] = Forms!
Frm_Request![Accounting_Reference_No]"
DoCmd.OpenReport stDocName, acPreview
End If
End If
Thanks!
Emma