Combo box troubles

Sess

Registered User.
Local time
Today, 10:55
Joined
Jan 4, 2010
Messages
74
I have a Combo Box on a unbound form that has its RowSource populated based on what is typed in a text box. The end user would be entering in a text and then select an item from the Combo Box which would populate other fields from other fields brought in to the columns of the Combo Box.
The trouble I have is that when you select an item from the Combo Box the other fields populate correctly but the Combo Box still only displays the first item in the pulldown and not the item selected from the list.

Can someone tell me where it can be set so the item shown is the one selected?
 
Have you tried this on the afterupdate event on the combo box?

me.combobox = me.yourtextfieldhere.
 
Thanks - it did not change anything when I added that.

In the AfterUpdate of Text1 I have this
Code:
Combo2.RowSource = "SELECT Table1.FIeld1, Table2.Field1, Table2.Field2, Table2.Field2 " & _
        "FROM Table2 INNER JOIN Table1 ON Table2.Field4 = Table1.Field4 " & _
        "WHERE Table1.Field1 = '" & Left(Me.Text1, 11) & "';"

Then in the AfterUpdate of Combo2 I have
Code:
Me.Text4 = Me.Combo2.Column(1)
Me.Text6 = Me.Combo2.Column(2)
Me.Text8 = Me.Combo2.Column(3)

The Text4 Text6 and Text8 all update how they should but the value displaying in Combo2 shows the first option and not the value that has been chosen. How can I get Combo2 to display the option chosen?

Have you tried this on the afterupdate event on the combo box?

me.combobox = me.yourtextfieldhere.
 
I figured it out - I have my Column Widths in Combo2 set to 0";2";0";0" so I just swapped Table1.Field1. and Table2.Field1 in the Select and set the Column Width to 2";0";0";0". Now it shows what is selected and not just the first value on the list.
Thank you for reading and suggesting.
 

Users who are viewing this thread

Back
Top Bottom