Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Select ListBox

Status
Not open for further replies.

jminn0311

Technical User
Joined
Jan 7, 2004
Messages
66
Location
US
I have a form with a MultiSelect listbox that is bound to a field in a table. The listbox is populated from a query of another table. After selecting from the listbox the information is not written to the table that the form is bound to. What am I doing wrong or is this even possible?

Thanks,

Jeff M.
 
Jeff,

The list for the listbox could be based on your query or another table but if the control is not bound to the table that you want the data written to it will appear there.

Hope this helps,

Steve
 
Steve,

The listbox is bound to the field in the table where I want the information stored. The listbox is populated by a query of a linked table in another database. It was my understanding that when I selected items in the listbox those values would populate the field in my table to which the control(listbox) is bound. What am I doing wrong. If I select items in the listbox, then close the form and open it back up again they are no longer selected.
Thank you,

Jeff M.
 
I got it to work when multi select is turned off but when it is turned back on it does not work again. Any help is greatly appreciated as I am at a standstill trying to figure this out.
 
How are ya jminn0311 . . . . .

Think about what your doing . . . . If your [blue]bound[/blue] to a field, then [blue]you can only store one selection[/blue] . . . . not multiple. If you could, you'd be talking as many records as you have selections.

So, [purple]your purpose of the listbox is not the desired function of the listbox[/purple]. And thats the key here!

What is its purpose/function as far as multiselect is concerned?

What are you expecting it to do?

Calvin.gif
See Ya! . . . . . .
 
I was thinking it would store the multiple selections in one field separated by commas. I am pretty sure I read it in the help menu and it sounded too good to be true. What is the function of multiselect exactly? I was trying to create something like

Condition1 Condition2 Condition3 PossibleSolutions
ComboBox ComboBox ComboBox LB(multiselect)

I was trying to do this without having to do a one to many relationship to another table. As the form is already several layers into subforms. Is it possible?

 
jminn0311 said:
[blue] I was thinking it would store the multiple selections in one field separated by commas.[/blue]
No can do . . . . [blue]Unbound, and with code, no problem![/blue]
jminn0311 said:
[blue]I was trying to do this without having to do a one to many relationship to another table.[/blue]
Bad Idea. Besides the fact that I'm not gonna promote bad programming habits, [purple]you need to make a decision here[/purple], before you attempt to do anything else with the DB.

Relationships can make or break any DB design. Ease of coding is one of its major byproducts. If you think/know you should make one, then you should at least try it. You have no Idea how much trouble you can save yourself down the road, including the present.

Calvin.gif
See Ya! . . . . . .
 
jminn0311,

TheAceMan1 has some valid points. You can absolutely achieve what you want through unbinding the control and writing some vba code. What I believe TheAceMan is focusing on is the larger picture. If you would care to open up the scope of your project a little more, perhaps one of us can give you some pointers on the relationships.

Good Luck,

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top