Hi there,

Is it possible to generate a crystal report by value of a combo box?


I set up a report to show all the fields i need. I want to have a combo box with all my Suppliers in. When I select a supplier I want to see the data only for the selected supplier.

I can call up a normal report where there are no conditions:
Private Sub cmdPrint_Click()
rptOutstandingLeads.ReportFileName = App.Path & "\UserReports\outstandinglead.rpt"
rptOutstandingLeads.WindowState = crptMaximized
End Sub
I need my client to select the supllier he wants to see data for.

The code I have so far is"
Private Sub cmdSup_Click()
Dim sup As String
sup = cmbSupplier.Text

rptSupplier.ReportFileName = App.Path & "\UserReports\stockbysupplier.rpt"
strSQL = "SELECT * FROM tblProduct WHERE [SUPPLIER]= (sup)"
'This is where I get stuck
End Sub
Can anyone help, please?