Open report based on Combo Box

flavi

Avg Access Guy
Local time
Today, 09:32
Joined
Jun 16, 2008
Messages
14
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.

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
 
Try removing the Parens from the DoCmd.OpenReport lines.

Alan
 

Users who are viewing this thread

Back
Top Bottom