Here is the VB Code to open a report based on ONE multiselect listbox.
Private Sub Command4_Click()
For Each varItem In Me![List0].ItemsSelected
StrWhere = StrWhere & "Spt_Fac =" _
& Chr(39) & Me![List0].Column(0, varItem) & Chr(39) & " Or "
Next varItem
Next varItem
StrWhere = Left(StrWhere, Len(StrWhere) - 4)
DoCmd.OpenReport "rpt_99NOC", acViewPreview, , StrWhere
End Sub
If I wanted to put two or three multiselect list box on my form and allow the user to pick from them to query and produce the report, what would the VB code for that be???
Please help. Thanks in advance!
Private Sub Command4_Click()
For Each varItem In Me![List0].ItemsSelected
StrWhere = StrWhere & "Spt_Fac =" _
& Chr(39) & Me![List0].Column(0, varItem) & Chr(39) & " Or "
Next varItem
Next varItem
StrWhere = Left(StrWhere, Len(StrWhere) - 4)
DoCmd.OpenReport "rpt_99NOC", acViewPreview, , StrWhere
End Sub
If I wanted to put two or three multiselect list box on my form and allow the user to pick from them to query and produce the report, what would the VB code for that be???
Please help. Thanks in advance!