Using a combo boxes in different forms that link to the same table

S

Secret Squirrel

I have two forms that I use for data entry into my database. They both have
their own table set up for the data. I have another table with the customer
names in it. I have the relationships set up to both of those tables. When in
either for I can click in this combo box and select a customer from the list.
When I run a query or report for one of the tables the customer name shows up
perfectly. When I run a query or report for the other I get the customerID #
instead. I have just two fields in the customer table. One for the customerid
and the other for the customer name. I have the properties set up for both of
these combo boxes exactly the same. Why would one show the id# and the other
show the actual name when I run queries or reports?
 
L

Larry Daugherty

Compare the properties of the comboboxes, particularly the Bound
Coulmn value.

HTH
 
S

Secret Squirrel

I did that. The one that works fine is set to "2" and the one that doesn't
work is set to "1". But when I change it to "2" it only shows me the numbers
in my combo box. When it's set to "1" I can see my customer names in the
combo box. What else could it be?
 
K

Ken Snell [MVP]

Just a guess, but are you using the "Lookup" feature for the customerID
field in one of the tables, where you display the customer name in that
field, but actually store the customerID in the field?
 
S

Secret Squirrel

You lost me on that one. In the table the "Lookup" feature is set to textbox
for both tables. Should that be set to a combo box?
 
S

Secret Squirrel

The customer name shows up in both boxes on the form but when I run queries
from one of them the customerid shows up. And the other one works fine. I
have the row source for both of them tied into a sort query.
 
K

Ken Snell [MVP]

No, textbox is correct. That means you're *not* using lookup fields, and
that is good.

When you compare the combo box properties, both have the same Bound Column
number? Do both combo boxes' Row Source queries have the order of the fields
exactly the same?

What is the recordsource for the report? Is it the same report in both
cases?

Either the combo boxes differ in which field is the Bound Column from the
query, or the report differs in some way for the query or the control's
Control Source.

If my questions seem to miss the mark, it'll be good if you can give us more
details about exactly what report or reports you're running, what are the
reports' properties (including the queries used as the recordsource), etc.

--

Ken Snell
<MS ACCESS MVP>
 
S

Secret Squirrel

Thanks for all that infomation but I figured it out. What happened was I had
the bound column set to "1" when I originally set it up. There was data
entered into the table via that form before I caught that it was set to "1".
I then changed it to "2" but I never went back and re-entered the data into
that combo box. I guess once you make a change like that it reverts back to
the ID # even though it is set up the correct way. I guess Access didn't
recognize that change and reset all the data in that field. I hope I'm making
sense here as I am half asleep. Thanks again for your help trying to figure
this out.
 
K

Ken Snell [MVP]

The Bound Column tells the form which field's data are to be stored in the
underlying table's field. When you had it set at 1, the value of the first
field in the Row Source query was what was stored in the underlying table --
when you changed it to 2, from that point on the form then saved the value
of the second field into the underlying table. However, ACCESS would not
have known that the data entered while the Bound Column was 1 should be
"updated" because you changed the Bound Column to 2.

Glad you found the answer.
 
Top