Solved Show values of a multivalue combobox in a textbox

anski

Registered User.
Local time
Today, 18:44
Joined
Sep 5, 2009
Messages
93
How can I show all the chosen values in a multivalue combobox in a textbox? When only one value is chosen, this value appears in the textbox. But when more than one value is chosen, the textbox does not show anything.
 
Well if it was a multivalue listbox, I would walk through the list and concatenate all those selected into a string variable and then set the textbox control to that variable.
 
That doesn't sound like a normal behavior. Try adding a new combobox using the Wizard just to see if the problem is the same.
 
How can I show all the chosen values in a multivalue combobox in a textbox? When only one value is chosen, this value appears in the textbox. But when more than one value is chosen, the textbox does not show anything.
There are inherent limitations to multi-value fields. There is no such thing as a "multivalue combobox" in the interface, so this must actually be an MVF in the table. There are techniques for extracting data from these things, and there are experts here who've taken the deep dive to figure out how to do that.

However, the more standard, reasonable approach is to avoid them in favor of a proper relational table design.
 
here is a sample on how to get the values of the MVF.
open SampleForm form and choose values from multi-value field (Idx).
 

Attachments

here is a sample on how to get the values of the MVF.
open SampleForm form and choose values from multi-value field (Idx).
thanks arnelgp. this correctly shows in a textbox all the chosen values in a combobox. how do i show the corresponding name? the values shown are the account codes. i would like to show the corresponding account names.
 
you need to add Dlookup() to fetch the actual account names.
upload a db and i will show it to you.
 
Wouldn't a recordset be better with IN()?
 
you need to add Dlookup() to fetch the actual account names.
upload a db and i will show it to you.
i used your db. however, i noticed that when i close the form and open it again, the values are no longer shown. i have to open the combobox and click on ok again for the values to be shown in the box.
 

Attachments

here try it now. also check the code on idx_AfterUpdate event and the form's current event.
 

Attachments

Users who are viewing this thread

Back
Top Bottom