Combo Box Shows Values on Text box (1 Viewer)

stu_c

Registered User.
Local time
Today, 18:50
Joined
Sep 20, 2007
Messages
489
Hi all
sorry to bombard today!
I have a combo box with 3 fields within, when a user selects from the drop down list I want a text box to show one of the other columns within the text box.

I have changed the control source of the text box to the combo box name but I cannot get it to show a different column apart from column1 :(
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:50
Joined
May 7, 2009
Messages
19,231
three column:

1st column you refer as cboName.Column(0)
2nd column, cboName,Column(1)


the combobox is zero (0) based.
 

stu_c

Registered User.
Local time
Today, 18:50
Joined
Sep 20, 2007
Messages
489
Thank you guys!
I know how to put different information from different fields into one text for example
=[COMBOBOX1] & [COMBOX2]

Is it possible for them to be on different lines in the text box?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:50
Joined
May 7, 2009
Messages
19,231
add vbCrLf to your expression:

=[combobox1] & vbCrLf & [combobox2]
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:50
Joined
Oct 29, 2018
Messages
21,449
Thank you guys!
I know how to put different information from different fields into one text for example
=[COMBOBOX1] & [COMBOX2]

Is it possible for them to be on different lines in the text box?
Hi. If vbCrLf doesn't work, you could try it this way:
Code:
=[Combo1] & Chr(13) & Chr(10) & [Combo2]
Hope it helps...
 

stu_c

Registered User.
Local time
Today, 18:50
Joined
Sep 20, 2007
Messages
489
Hi. If vbCrLf doesn't work, you could try it this way:
Code:
=[Combo1] & Chr(13) & Chr(10) & [Combo2]
Hope it helps...

thank you this worked, are you able to explain what the relevance of
Chr(13) & Chr(10) is just for future reference?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:50
Joined
Oct 29, 2018
Messages
21,449
thank you this worked, are you able to explain what the relevance of
Chr(13) & Chr(10) is just for future reference?
Hi. Glad to hear you got it to work, and I see moke123 already answered your other question. Good luck with your project.
 

Users who are viewing this thread

Top Bottom