S
Steven Summers
I am tring to wire up a form with a multiselect listbox to a query. I use
the following code to populate a hidden textbox:
Dim stDocName As String
Dim ctlList As Control, varItem As Variant
txtCenter.Value = ""
' Return Control object variable pointing to list box.
Set ctlList = Forms!ELSummary!lstcenter
' Enumerate through selected items.
For Each varItem In ctlList.ItemsSelected
txtCenter.Value = txtCenter.Value & "'" & ctlList.ItemData(varItem)
& "', "
Next varItem
txtCenter.Value = "In(" & Left(txtCenter.Value, Len(txtCenter.Value) - 2) &
")"
When I tie my query to this control, the query doesn't return any rows of
data. If I hard code the IN('4200102','4200211') in the query, it works
fine. Am I missing something here?
Thanks for any help you may offer.
Steven Summers
the following code to populate a hidden textbox:
Dim stDocName As String
Dim ctlList As Control, varItem As Variant
txtCenter.Value = ""
' Return Control object variable pointing to list box.
Set ctlList = Forms!ELSummary!lstcenter
' Enumerate through selected items.
For Each varItem In ctlList.ItemsSelected
txtCenter.Value = txtCenter.Value & "'" & ctlList.ItemData(varItem)
& "', "
Next varItem
txtCenter.Value = "In(" & Left(txtCenter.Value, Len(txtCenter.Value) - 2) &
")"
When I tie my query to this control, the query doesn't return any rows of
data. If I hard code the IN('4200102','4200211') in the query, it works
fine. Am I missing something here?
Thanks for any help you may offer.
Steven Summers