Combo Box column reference

J

Jim

I have a combo box with two columns: ItemCode,
ItemDescription.

The bound column is 1 (ItemCode). I want to return the
value of the second colum to a field in the form. I can
do that if I use the expression: =[Combo22].[column](1)in
the textbox control source. However the value is only
visible in the form burt does not show up in the
underlying table. So I tried binding the control source
to the appropriate field in the underlying table and
placing the expression in the "Default VAlue" property of
the textbox but that returns a blank.

Any suggestions?
 
J

John Vinson

However the value is only
visible in the form burt does not show up in the
underlying table.

Why would you WANT to store it redundantly in the underlying table!?

You're using a relational database. Use it relationally! The
Description should be stored only once, and linked using Queries (or
other tools such as a combo box, as you're doing) for display or
printing.
 
N

Norm1111

If you want to do this just because you can then try this:

go to the propperties of the combo box and then press on the EVENT
tab.

Now in this list about 5 down "ON CHANGE" press the little 3 dots ...

and go to the code builder.

when the code builder comes up paste the code below


-------------------------------------------------------

name_of Text_Box.value=[Combo22].[column](1)

-------------------------------------------------------


name_of Text_Box.value ----------> this is the name of your text box,
be sure to leave the ".value=[Combo22].[column](1)" in the code.

press FILE ---> SAVE

and close the code builder

Now is all you have to do is put the origional textbox control source
back to the tables cell.

hope it works I havn't tried it with the two field thing before.
 
J

Jim

Well JOHN, I suppose I want to store the value
redundantly in the underlying table so I can create
queries and reports which list the Item Description along
with the Item Code. You see, my vendors don't have a clue
what my item codes mean so I can't send them a purchase
order with a list of codes.
Now, I am new at this GET IT!? I see my code and
description in my form but I can't build a query or
report on a form right?
 
J

John Vinson

Well JOHN, I suppose I want to store the value
redundantly in the underlying table so I can create
queries and reports which list the Item Description along
with the Item Code. You see, my vendors don't have a clue
what my item codes mean so I can't send them a purchase
order with a list of codes.
Now, I am new at this GET IT!? I see my code and
description in my form but I can't build a query or
report on a form right?

I'm sorry about the sarcastic tone of my previous message. It was
inappropriate, and I apologize.

On the contrary: Forms and Reports can and should be based on Queries.
If you are assuming that you must have the description in the Purchase
Order table in order to have it on a Purchase Order report, that's the
source of your problem! You do NOT need to have it in the same table.
Instead, you can create a Query linking the Purchase Order table to
the Items table, and base your report on that Query, pulling the
purchase order information from the PO table, and the description from
the Items table.
 
Top