Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box data type wrong

Status
Not open for further replies.

PCX

Technical User
Dec 17, 2000
54
US
I hope this is not so simple that it embarrasses me.

I have a form with two combo boxes. Box1 has the ProductName and the control source is the ProductName field in the Product table.

Box2 is the ProductSize and the control source is the ProductName field also.

When I enter a ProductName in Box1, Box2 updates with the appropriate ProductSize in Box2.

The problem is, that I want to do a calculation on the ProductSize in Box2. The value shown in Box2 appears to be a number (30) but actually it is the ProductName (Bolts) and I can't add that value.

Is there a way to pass the displayed value to either the table or to another field on the form?

Thanks
 
Typically, the combo box is built with multiple columns and the key column is hidden from view. When you select the value of the combo box Access returns the value of the hidden column. Instead of using the default combo box value, you must specify the column for the value you want. Try the following.

ProdSize = combo11.column(1)

Use column(1) because usually the hidden column is column(0). Terry

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top