Multiple select combobox Subject add to a textbox (1 Viewer)

ZKHADI

Member
Local time
Today, 18:39
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: 132

Gasman

Enthusiastic Amateur
Local time
Today, 14:39
Joined
Sep 21, 2011
Messages
14,223
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?
 

ZKHADI

Member
Local time
Today, 18:39
Joined
Apr 5, 2021
Messages
118
error
 

Attachments

  • Untitled.png
    Untitled.png
    3.4 KB · Views: 137

Gasman

Enthusiastic Amateur
Local time
Today, 14:39
Joined
Sep 21, 2011
Messages
14,223
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:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:39
Joined
May 7, 2009
Messages
19,231
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.
 

ZKHADI

Member
Local time
Today, 18:39
Joined
Apr 5, 2021
Messages
118
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:39
Joined
May 7, 2009
Messages
19,231
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.
 

ZKHADI

Member
Local time
Today, 18:39
Joined
Apr 5, 2021
Messages
118
but is it possible that from a single combobox on click even we put multiple values to one textbox?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:39
Joined
Feb 19, 2013
Messages
16,606
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
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:39
Joined
Feb 19, 2002
Messages
43,213
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

Top Bottom