Multiple select combobox Subject add to a textbox

ZKHADI

Member
Local time
Today, 15:35
Joined
Apr 5, 2021
Messages
118
hy buddies:

i have a form with multiple subject combobox. the problem is that the combobox selected subjects are not putting in textbox.
if select one subject then it updated in textbox but if select more than 1 the old 1 subject also disappear.
i coded the combobox on click even as shown in the picture.

how I can put the multiple subjects in textbox by separate with comma?

check image below please
 

Attachments

  • Untitled.png
    Untitled.png
    79.7 KB · Views: 163
You need to concatentae each value
Me.Textbox = Me.textbox & "," & Me.combo

I will leave you to work out how not to add a , at the start of the textbox.
If the textbox is locked, you would also need a way to clear it and start again?
 
error
 

Attachments

  • Untitled.png
    Untitled.png
    3.4 KB · Views: 167
That is because you have NOT written what I suggested? :(

If you are going to program computers, you have to be exact all the time. Pretty close is not good enough.

Look at what I wrote, then what you wrote and see if you can spot the difference.
 
Last edited:
i have a form with multiple subject combobox.
you already have it as Multiselect Combobox, so selecting more than 1 will automatically put the comma for you.
 
you already have it as Multiselect Combobox, so selecting more than 1 will automatically put the comma for you.
yes but the problem is when fill in word these subjects still empty. so i need to put these subjects to the textbox then it will fill in word. directly fill in word from combobox is not working
 
directly fill in word from combobox is not working
it will not work since you cannot "put" an item to the combo that is not in the list.
it is different from the "normal" single select combobox where you can type a word not in the list
and it will be added.
 
but is it possible that from a single combobox on click even we put multiple values to one textbox?
 
but is it possible that from a single combobox on click even we put multiple values to one textbox?
if by that you mean one click, multiple values then no - unless those values are in the same row of the combo.

if you mean one click per value, then gasman has already shown you the solution

the problem is when fill in word these subjects still empty. so i need to put these subjects to the textbox then it will fill in word. directly fill in word from combobox is not working
suggest show some examples of what you mean
 
Storing multiple values in a single field is poor practice. Either use a multi-value field or do it the right way with a many-side table and a subform. At least using a multi-value field however bad they are, gives you the option of working with the data assuming you are willing to learn the correct SQL commands.
 

Users who are viewing this thread

Back
Top Bottom