Hello,
I am getting the following error when I try to run a report - "The Action or method requires a Report Name Argument".
Background - I basically have a form with different boxes and based on what the vendor name is (List14 in the code below), it should run a particular report.
Code -
Dim stDocName As String
Dim stLinkCriteria As String
stDocPS = "RPT_EC_ENGAGEMENTS"
stDocCC = "RPT_CC_ENGAGEMENTS"
stDocIE = "RPT_IE_ENGAGEMENTS"
stDocLW = "RPT_LW_ENGAGEMENTS"
stLinkCriteria = "[ENGAGEMENT_ACCESS_ID]=" & Me![Text0]
Select Case Me.List14 (//this is the vendor box//)
Case "PS"
stDocName = stDocPS
Case "CC"
stDocName = stDocCC
Case "IE"
stDocName = stDocIE
Case "LW"
stDocName = stDocLW
End Select
DoCmd.OpenReport stDocName, acViewReport, stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF
DoCmd.Close acReport, stDocName, acSaveYes
I am getting the following error when I try to run a report - "The Action or method requires a Report Name Argument".
Background - I basically have a form with different boxes and based on what the vendor name is (List14 in the code below), it should run a particular report.
Code -
Dim stDocName As String
Dim stLinkCriteria As String
stDocPS = "RPT_EC_ENGAGEMENTS"
stDocCC = "RPT_CC_ENGAGEMENTS"
stDocIE = "RPT_IE_ENGAGEMENTS"
stDocLW = "RPT_LW_ENGAGEMENTS"
stLinkCriteria = "[ENGAGEMENT_ACCESS_ID]=" & Me![Text0]
Select Case Me.List14 (//this is the vendor box//)
Case "PS"
stDocName = stDocPS
Case "CC"
stDocName = stDocCC
Case "IE"
stDocName = stDocIE
Case "LW"
stDocName = stDocLW
End Select
DoCmd.OpenReport stDocName, acViewReport, stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF
DoCmd.Close acReport, stDocName, acSaveYes