Hi, Currently I have a form that allows a user to select multiple items from a listbox, clicks ok and the VB procedure runs a query based on the multiple selections made. I want to add another multi-valued field so user selects from both multi-valued listboxes to filter my query (natureofwork AND usetype) I am very new to VB code and have no idea how to do it.
Any help is greatly appreciated!
Here is my VB procedure that is working for one multi-valued list:

Private Sub cmdOK_Click()
Dim Q As QueryDef, db As Database
Dim criteria As String
Dim ctl As Control
Dim itm As Variant

Set ctl = Me!cbonatureofwork
For Each itm In ctl.ItemsSelected
If Len(criteria) = 0 Then
criteria = Chr(34) & ctl.ItemData(itm) & Chr(34)
criteria = criteria & "," & Chr(34) & ctl.ItemData(itm) & Chr(34)
End If
Next itm
If Len(criteria) = 0 Then
itm = MsgBox("You must select one or more items in the" & _
" list box!", 0, "No selection made")
Exit Sub
End If
Set db = CurrentDb()
Set Q = db.QueryDefs("projectsbynatureofwork")
Set db = CurrentDb()
Set Q = db.QueryDefs("projectsbynatureofwork")
Q.SQL = "Select [Healthcare Projects].* FROM[Healthcare Projects]Where([natureofwork].value) In (" & criteria & _
DoCmd.OpenQuery "projectsbynatureofwork"

End Sub