Hello,
I have a listbox on a form which is used to view data from different table. The listbox is populated by a combox and each query uses the combo as criteria.
I have added a cmd button that should print a report based on the list box row source but only works with one report.
Can someone help me so that I can get this code to work? Than you
I have a listbox on a form which is used to view data from different table. The listbox is populated by a combox and each query uses the combo as criteria.
I have added a cmd button that should print a report based on the list box row source but only works with one report.
Can someone help me so that I can get this code to work? Than you
Code:
If Me.lstsearch.RowSource = "qry1" Then
DoCmd.OpenReport "rpt1", acNormal, , strWhere
End If
If Me.lstsearch.RowSource = "qry2" Then
DoCmd.OpenReport "rpt2", acNormal, , strWhere
End If