Combo Box and ListIndex problem

M

Moche

I have a combo Box that is connected to a table with two fields. The first
field is a code and the second is the code description. I understand that if
you set the listindex to 1; that refers to column one and so on. What I did
was set the listindex to 0 (zero) which is what is being stored in a table
which is meaningless. So the basic problem is that the value that is now
stored in the table is a meaningless number which is the listindex value. I
have changed the listindex value to one (1) and in the form where the combo
box is used you can see the desired value, but the underlying table has some
other value. How can I fix this?
 
K

Klatuu

The ListIndex propery is 0 based.
It does not refer to column, but to a row.

Setting the ListIndex is the same as selecting a row in a combo.

If you want to return the second column from the selected row in a combo
box, this will do it:
forms!form1!combo12.column(forms!form1!combo12.listindex,1)
 
J

John W. Vinson

I have a combo Box that is connected to a table with two fields. The first
field is a code and the second is the code description. I understand that if
you set the listindex to 1; that refers to column one and so on. What I did
was set the listindex to 0 (zero) which is what is being stored in a table
which is meaningless. So the basic problem is that the value that is now
stored in the table is a meaningless number which is the listindex value. I
have changed the listindex value to one (1) and in the form where the combo
box is used you can see the desired value, but the underlying table has some
other value. How can I fix this?

You'll need to run an Update query updating the table field to the correct
value. Can you determine - based on the combo's properties - what is in fact
the correct value? Have you (I hope not!!!!) entered some records with the
corrected combo which might conflict with the erroneous values?


John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top