Would anyone be able to suggest a way to open a report based on a combo box selection?
I have a combo box which has 2 values, "Net" and "Rebate"
If a user selects Net and clicks on the submit button, it would open the report, rptNET. If they select rebate, and clicks on the submit button, then the report rptREBATE opens. I have tried with VB using a If Then statement, but not sure what I am doing wrong? I appreciate any help.
I have a combo box which has 2 values, "Net" and "Rebate"
If a user selects Net and clicks on the submit button, it would open the report, rptNET. If they select rebate, and clicks on the submit button, then the report rptREBATE opens. I have tried with VB using a If Then statement, but not sure what I am doing wrong? I appreciate any help.
Code:
Private Sub Command32_Click()
If txt56 = "Rebate" Then
DoCmd.OpenReport(rptREBATE,acViewPreview,,,acWindowNormal)
ElseIf txt56 = "Net" Then
DoCmd.OpenReport(rptNET,acViewPreview,,,acWindowNormal)
End If
End Sub