Dear experts -
I have an unbound combo box on a form that is populated from a union query.
Each ROW is unique, but not the first field.
I am listing:
Account, Brand, Division - there are multiple brands in a given account (from different table), for example.
Thus, the data can look like this:
etc. [each number is a foreign key from another table]
The question - I have code that can scan the combo box and come upon the right record, which i then want to be THE ONE SELECTED. But since there is no unique first field, I am not sure how to do this. I seem to have the 'row number' - can I highlight the right record based on that?
Note that the code IS hitting the right record (i.e., when i put a breakpoint on 'j=true' it stops at the right item in the combo box.
For i = 0 To Me.cboBrand_ID.ListCount - 1
If Val(Me.cboBrand_ID.Column(0, i)) = Nz(Me.txtAccount_ID, 0) And Val(Me.cboBrand_ID.Column(1, i)) = Nz(Me.txtBrand_ID, 0) And Val(Me.cboBrand_ID.Column(2, i)) = Nz(Me.txtAccountdivision_ID, 0) Then
j = True
Me.cboBrand_ID.Value = Me.cboBrand_ID.ItemData(i) 'DOES NOT WORK, SINCE itemdata is not unique!