Combo Box Problem

R

Robert

I have a combo Box on a form the CB row source is a table with about 50 codes
and a text field that holds a text description of what the code means. This
CB is used to select an agency code that corresponnds to the agency name.
This avoid any data entry error. Now the problem. When you scroll through the
records on the forms' CB you can see all the correct codes, but when I open
the table that is populated by the CB I see code that don't make any sense.
They do not correspond to what is seen on the form. Why are they different?
How can I fix this? I need this fixed in order to create a report from the
data in the table.

Thanks
 
J

John W. Vinson

I have a combo Box on a form the CB row source is a table with about 50 codes
and a text field that holds a text description of what the code means. This
CB is used to select an agency code that corresponnds to the agency name.
This avoid any data entry error. Now the problem. When you scroll through the
records on the forms' CB you can see all the correct codes, but when I open
the table that is populated by the CB I see code that don't make any sense.
They do not correspond to what is seen on the form. Why are they different?
How can I fix this? I need this fixed in order to create a report from the
data in the table.

Thanks

The table does not - *and should not!* - contain the text description. It
contains the meaningless ID field from the lookup table - the codes, or
(depending on how you set up the table) a numeric ID primary key value.

Base your report, not on the table, but on a Query joining the table to the
50-row codes table.
 
J

John W. Vinson

Thanks for the suggestion. I know that you replied some time ago but I don't
think I was clear. I understand how to create the report which is not the
issue at all. The issue very simple is that the data in the table is
different from what is selected in the combo box. For example if the value in
the CB is 002 the corresponding record has 0 (zero) if the value is 025 the
corresponding value is 13 and so on and so forth. What is interesting is that
if I change the bound column value from 0 (zero) to 1 (one) the value
displayed in the CB is the same as in the table. Have you ever seen anything
like this?

Sorry I misunderstood the question!

The column position property is annoyingly inconsistant. If you're using the
Column property it's zero based; but if you're using the BoundColumn property
it's *1* based! So 1 is the first column in the RowSource query - the ID here,
I'm presuming. There is a (normally hidden) column 0, which is (I believe) the
current sequential row number.
 
R

Robert

How does this information help me fix the values in the table which are
incorrect?

Rob
 
J

John W. Vinson

How does this information help me fix the values in the table which are
incorrect?

Unfortunately I can't see that it does very much. If you have wrong data
you'll need to identify the wrong data and fix it. You might be lucky and have
a consistant mapping, but if so you'll still need to track down the mapping
and run an update query to fix it.
 
R

Robert

The mapping idea is good and I also thought of it. However the situation is
still the same for future data entry; the values will go into the table
incorrectly. I guess I will have to create a new combo box and test it to
make sure it insert correctly and go from there.

Thanks
 
J

John W. Vinson

The mapping idea is good and I also thought of it. However the situation is
still the same for future data entry; the values will go into the table
incorrectly. I guess I will have to create a new combo box and test it to
make sure it insert correctly and go from there.

ummm... of course. If you have an error in the design of your combo box, fix
the error before adding more data! I assumed that went without saying.

You don't need a new combo though, just change the bound column property.
 

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