K
Karen
The code I have below uses values from a multi-select
field and puts it in a text box. It works until that
point. If I select a single item, the query works. The
query does not work when I select more than one items in
the multi-select list.
I have searched and found that I could pass the whole
select statement from the code...I have been able to
create the code but am not sure how I would launch the
query.....
Private Sub List14_Exit(Cancel As Integer)
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strSQL As String
Set frm = Forms!DateRangeDialog
Set ctl = frm!List14
For Each varItem In ctl.ItemsSelected
strSQL = strSQL & ctl.ItemData(varItem) & Chr$(34)
& "," & """"
Next varItem
strSQL = Left$(strSQL, (Len(strSQL) - 3))
Me!Text19 = strSQL
End Sub
field and puts it in a text box. It works until that
point. If I select a single item, the query works. The
query does not work when I select more than one items in
the multi-select list.
I have searched and found that I could pass the whole
select statement from the code...I have been able to
create the code but am not sure how I would launch the
query.....
Private Sub List14_Exit(Cancel As Integer)
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strSQL As String
Set frm = Forms!DateRangeDialog
Set ctl = frm!List14
For Each varItem In ctl.ItemsSelected
strSQL = strSQL & ctl.ItemData(varItem) & Chr$(34)
& "," & """"
Next varItem
strSQL = Left$(strSQL, (Len(strSQL) - 3))
Me!Text19 = strSQL
End Sub