NewfieGolfer
Technical User
Hi All,
I have a combo box on form1. The user selects from the combo box. If the combo box doesn't contain the appropriate value, the user hits a button and opens another form (form2). They input the value in this form. The combo box on form1 is linked to that table. So, as the user inputs data into form2, the combo box on form1 populates.
On form 1, once the user makes the selection from the combo box (that has 4 columns) the data in each column is copied to 4 text boxes.
So if the data in the combo box looks like this:
x a b c
x f w d
x d w k
y w q p
y s e f
and i select row 2 (x f w d) or row 3 (x d w k) then the text boxes display the data in row 1. also, if i select row 4, the text boxes display the data in row 3.
Here's the code i use on the lost focus event of the combo box:
Dim varitem As Variant
varitem = Combo26.ListIndex
[text1] = Combo26.Column(0, varitem)
[text2] = Combo26.Column(1, varitem)
[text3] = Combo26.Column(2, varitem)
[text4] = Combo26.Column(3, varitem)
what am i missing here so that when i select a row, the text boxes display that values in that row?
Any help appreciated,
NG
I have a combo box on form1. The user selects from the combo box. If the combo box doesn't contain the appropriate value, the user hits a button and opens another form (form2). They input the value in this form. The combo box on form1 is linked to that table. So, as the user inputs data into form2, the combo box on form1 populates.
On form 1, once the user makes the selection from the combo box (that has 4 columns) the data in each column is copied to 4 text boxes.
So if the data in the combo box looks like this:
x a b c
x f w d
x d w k
y w q p
y s e f
and i select row 2 (x f w d) or row 3 (x d w k) then the text boxes display the data in row 1. also, if i select row 4, the text boxes display the data in row 3.
Here's the code i use on the lost focus event of the combo box:
Dim varitem As Variant
varitem = Combo26.ListIndex
[text1] = Combo26.Column(0, varitem)
[text2] = Combo26.Column(1, varitem)
[text3] = Combo26.Column(2, varitem)
[text4] = Combo26.Column(3, varitem)
what am i missing here so that when i select a row, the text boxes display that values in that row?
Any help appreciated,
NG