This code is also work fine.
I have 2 Listboxes in my form name frmMyForm.
The listboxes named list0 and list2.
I have a textbox named text4.
And I put this code to a command box event on click.
Private Sub Command3_Click()
Dim varItem As String
Dim i As Variant
' Build criteria...