i have an unbound form with 2 multiselect list boxes. grp & io.
the IO listbox is unbound and depends on the grp listbox but after finishing from the grp listbox i'm getting a null IO listbox.
the below code is tested and ok.
[code=vb]Dim V As Variant
Dim GRPS As String
If Me.grp.ItemsSel ected.Count > 0 Then
For Each V In Me.grp.ItemsSel ected
GRPS = GRPS & Me.grp.ItemData (V) & ","
Next V
GRPS = Left$(GRPS, Len(GRPS) - 1)
End If
If Len(GRPS) = 0 Then
GRPS = "like '*'"
Else
GRPS = "IN(" & GRPS & ")"
End If
SQLSTR = "SELECT internal_orders .ior_no, internal_orders .ior_descriptio n,internal_orde rs.ior_date, "
SQLSTR = SQLSTR & " internal_orders .io_grp FROM internal_orders "
SQLSTR = SQLSTR & " WHERE internal_orders .io_grp " & GRPS
Me.io.RowSource = SQLSTR[/code]
the IO listbox is unbound and depends on the grp listbox but after finishing from the grp listbox i'm getting a null IO listbox.
the below code is tested and ok.
[code=vb]Dim V As Variant
Dim GRPS As String
If Me.grp.ItemsSel ected.Count > 0 Then
For Each V In Me.grp.ItemsSel ected
GRPS = GRPS & Me.grp.ItemData (V) & ","
Next V
GRPS = Left$(GRPS, Len(GRPS) - 1)
End If
If Len(GRPS) = 0 Then
GRPS = "like '*'"
Else
GRPS = "IN(" & GRPS & ")"
End If
SQLSTR = "SELECT internal_orders .ior_no, internal_orders .ior_descriptio n,internal_orde rs.ior_date, "
SQLSTR = SQLSTR & " internal_orders .io_grp FROM internal_orders "
SQLSTR = SQLSTR & " WHERE internal_orders .io_grp " & GRPS
Me.io.RowSource = SQLSTR[/code]
Comment