View Full Version : Display combo box value in a text box


stimpy
08-02-2000, 04:55 PM
My form contains a text box and a combo box.
When a value is selected from the combo box I want it to be displayed in the text box.
The combo box contains a list of 4 digit postcodes(zipcodes. I have linked my text box to this combo box using the source property of the text box, but when I try it out I dont get the 4 digit value in the text box. Instead I get a 1 digit number that corresponds to the number in the list (eg if I choose the first postcode in the combobox then a 1 appears in the text box) I would greatly appreciate help on this as it is quite urgent
Thanks in advance

R. Hicks
08-02-2000, 05:35 PM
If your combobox's Row Source is linkined to multiple columns and the column you wish to use is not the bound column then you need to specify the column number in the control source in the txtbox. Remember that the column numbering is zero based, meaning that the first column is column(0). Here is an example that would work in the control source of a txtbox:

=[YourCombo].[Column](1)

"YourCombo" needs to be the actual name of your combobox. The would reflect the you want the second column of the Row Source to be linked to the txtbox.

HTH
RDH

Krij
07-01-2006, 02:33 AM
Hi!

Private Sub cboSomething_AfterUpdate()
Me!txtSomething.Text = Me!cboSomething.Column(1)
End Sub


My form contains a text box and a combo box.
When a value is selected from the combo box I want it to be displayed in the text box.
The combo box contains a list of 4 digit postcodes(zipcodes. I have linked my text box to this combo box using the source property of the text box, but when I try it out I dont get the 4 digit value in the text box. Instead I get a 1 digit number that corresponds to the number in the list (eg if I choose the first postcode in the combobox then a 1 appears in the text box) I would greatly appreciate help on this as it is quite urgent
Thanks in advance