append value from combobox

cmac2210

Registered User.
Local time
Today, 04:44
Joined
Mar 26, 2009
Messages
12
Experts
Here is what I have currently going on. On my form there is a list box (multiselect) that creates a criteria that is passed to a query. The problem is that I dont like the way the form looks with this huge list box. I would like to replace the listbox with a combobox and allow individuals to create a string of items that can be passed to the query. I would assume this can be done with a button to append the selected item in the combobox to a hidden textbox, but the method, I just cant seem to work out. Right now the criteria fromt he listbox is passed to the query and looks like "item1", "item2", "item3" etc. So the textbox will need to do the same thing if possible. Any help would be very appreciated.
 
Experts
Here is what I have currently going on. On my form there is a list box (multiselect) that creates a criteria that is passed to a query. The problem is that I dont like the way the form looks with this huge list box. I would like to replace the listbox with a combobox and allow individuals to create a string of items that can be passed to the query. I would assume this can be done with a button to append the selected item in the combobox to a hidden textbox, but the method, I just cant seem to work out. Right now the criteria fromt he listbox is passed to the query and looks like "item1", "item2", "item3" etc. So the textbox will need to do the same thing if possible. Any help would be very appreciated.

Okay, let's assume that you have a button to click after selecting the item in the combo and that the combo's bound column is the text. You can do this in the click event of the button:
Code:
If Len(Me.YourTextBox & "") = 0 Then
   Me.YourTextBox = Chr(34) & Me.YourComboBoxNameHere & Chr(34)
Else
   Me.YourTextBox = Me.YourTextBox & "," & Chr(34) & Me.YourComboBoxNameHere & Chr(34)
End If

See if that gets you on your way.
 
That is working great for setting a the list into the textbox! Now for the second part... is it possible to pass this list ("Item1", "Item2", "Item3") to a query to create a table populated with only the values from the list? I have been trying to get that to work with no luck. Any thoughts?
 

Users who are viewing this thread

Back
Top Bottom