I have 2 list boxes that I need to use as my creteria to run a report from a
query.
The code below worked for the first list box, how can I add the second as
part of my cretieria?
Note, the first list box contain NAME, and the second list box contain STATUS
Thanks
Private Sub Command11_Click()
Dim LBx As ListBox, Cri As String, DQ As String, itm
Set LBx = Me!List2
DQ = """"
If LBx.ItemsSelected.Count > 0 Then
For Each itm In LBx.ItemsSelected
If Cri <> "" Then
Cri = Cri & ", " & DQ & LBx.Column(1, itm) & DQ
Else
Cri = DQ & LBx.Column(1, itm) & DQ
End If
Next
Cri = "[NAME] In(" & Cri & ")"
Debug.Print Cri
End If
DoCmd.OpenReport "Step1_Member_Status", acViewPreview, , Cri
Set LBx = Nothing
End Sub
query.
The code below worked for the first list box, how can I add the second as
part of my cretieria?
Note, the first list box contain NAME, and the second list box contain STATUS
Thanks
Private Sub Command11_Click()
Dim LBx As ListBox, Cri As String, DQ As String, itm
Set LBx = Me!List2
DQ = """"
If LBx.ItemsSelected.Count > 0 Then
For Each itm In LBx.ItemsSelected
If Cri <> "" Then
Cri = Cri & ", " & DQ & LBx.Column(1, itm) & DQ
Else
Cri = DQ & LBx.Column(1, itm) & DQ
End If
Next
Cri = "[NAME] In(" & Cri & ")"
Debug.Print Cri
End If
DoCmd.OpenReport "Step1_Member_Status", acViewPreview, , Cri
Set LBx = Nothing
End Sub