Hello,
I have form where a user can choose criteria (PeopleSoft, ClickCommerce or InfoEd) and run a report (three different reports pertaining to what has been selected). So basically, I want it to run a specific report, when an option is chosen.
Below is the VB code i wrote (yeah, I know its full of errors, I am VERY new to Access). It doesn't seem to be doing anything
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocPeopleSoft = "RPT_EC_COMPARE"
stDocClickCommerce = "RPT_CC_COMPARISON"
stDocInfoEd = "RPT_IE_COMPARISON"
'Vendor Criteria
If Me!Combo15 = "PeopleSoft" Then
stLinkCriteria = stLinkCriteria & "[VENDOR]='" & Me!Combo15 & "'"
DoCmd.OpenReport stDocPeopleSoft, acViewReport, , stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF
ElseIf Me!Combo15 = "ClickCommerce" Then
stLinkCriteria = stLinkCriteria & "[VENDOR]='" & Me!Combo15 & "'"
DoCmd.OpenReport stDocClickCommerce, acViewReport, , stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF
: stLinkCriteria = stLinkCriteria & "[VENDOR] Like" & " '*' "
ElseIf Me!Combo15 = "InfoEd" Then
stLinkCriteria = stLinkCriteria & "[VENDOR]='" & Me!Combo15 & "'"
DoCmd.OpenReport stDocInfoEd, acViewReport, , stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF
End If
PLEASE HELP!!! I appreciate your time and patience!!!
I have form where a user can choose criteria (PeopleSoft, ClickCommerce or InfoEd) and run a report (three different reports pertaining to what has been selected). So basically, I want it to run a specific report, when an option is chosen.
Below is the VB code i wrote (yeah, I know its full of errors, I am VERY new to Access). It doesn't seem to be doing anything
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocPeopleSoft = "RPT_EC_COMPARE"
stDocClickCommerce = "RPT_CC_COMPARISON"
stDocInfoEd = "RPT_IE_COMPARISON"
'Vendor Criteria
If Me!Combo15 = "PeopleSoft" Then
stLinkCriteria = stLinkCriteria & "[VENDOR]='" & Me!Combo15 & "'"
DoCmd.OpenReport stDocPeopleSoft, acViewReport, , stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF
ElseIf Me!Combo15 = "ClickCommerce" Then
stLinkCriteria = stLinkCriteria & "[VENDOR]='" & Me!Combo15 & "'"
DoCmd.OpenReport stDocClickCommerce, acViewReport, , stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF
: stLinkCriteria = stLinkCriteria & "[VENDOR] Like" & " '*' "
ElseIf Me!Combo15 = "InfoEd" Then
stLinkCriteria = stLinkCriteria & "[VENDOR]='" & Me!Combo15 & "'"
DoCmd.OpenReport stDocInfoEd, acViewReport, , stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF
End If
PLEASE HELP!!! I appreciate your time and patience!!!