Multi Column Combo box Not finding correct record in Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a 5 column combo box that I created from the wizard. It should find
the record on my form that matches the record selected based on all 5 columns
(which happen to be keys as well). Sometimes some Columns may have duplicate
values and so it only looks at the first record I choose. If I choose a new
row that doesn't match column 1 then all the fields get updated correctly.
Example:
TREE APPLE GREEN SOUR 1
TREE APPLE GREEN SWEET 2
FLOWER MELON GREEN SWEET 1

So if I choose the first row the form will find the record that matches all
the columns in the first row. If I choose the second row, nothing happens.
If I choose the third row it finds the records that match the third row. I
have my bound column set to 1.
 
Tina,

What does the query look like that generates the values for your combo box?
What does the code look like behind the combo box after update event?

If you are using these 5 fields to come up with a composite key, then you
probably need a Autonumber primary key in this table which can be used in a
subsequent tables.

Dale
 
I have a 5 column combo box that I created from the wizard. It should find
the record on my form that matches the record selected based on all 5 columns
(which happen to be keys as well). Sometimes some Columns may have duplicate
values and so it only looks at the first record I choose. If I choose a new
row that doesn't match column 1 then all the fields get updated correctly.
Example:
TREE APPLE GREEN SOUR 1
TREE APPLE GREEN SWEET 2
FLOWER MELON GREEN SWEET 1

So if I choose the first row the form will find the record that matches all
the columns in the first row. If I choose the second row, nothing happens.
If I choose the third row it finds the records that match the third row. I
have my bound column set to 1.

A combo box has only one "bound column" - and you need five! I'm not sure how
you would do this using the combo box as a tool, other than by adding a
"surrogate key" such as an autonumber to your table, and using that field as
the bound column of the combo.

John W. Vinson [MVP]
 
Back
Top