R
ria
I have written the code below but, it is not working.
PLease help.
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
strSQL = ""
For Each varItem In ctl.ItemsSelected
strSQL = strSQL & ctl.ItemData(varItem) & "\""" & ","
& "\"""
strSQL = Left$(strSQL, Len(strSQL) - 5) +
Mid$(strSQL, Len(strSQL) - 3, 2) + Right$(strSQL, 1)
Next varItem
'Trim the end of strSQL
strSQL = Left$(strSQL, (Len(strSQL) - 3))
Me!Text19 = strSQL
End Sub
The data I use is text. I am using the data in Me!Text19
in the query.....
Thank you
PLease help.
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
strSQL = ""
For Each varItem In ctl.ItemsSelected
strSQL = strSQL & ctl.ItemData(varItem) & "\""" & ","
& "\"""
strSQL = Left$(strSQL, Len(strSQL) - 5) +
Mid$(strSQL, Len(strSQL) - 3, 2) + Right$(strSQL, 1)
Next varItem
'Trim the end of strSQL
strSQL = Left$(strSQL, (Len(strSQL) - 3))
Me!Text19 = strSQL
End Sub
The data I use is text. I am using the data in Me!Text19
in the query.....
Thank you