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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query from hidden column in combo box

Status
Not open for further replies.

MikeDNova

Programmer
Jul 3, 2002
86
0
0
US
hey guys,

i have three combo boxes with 2 columns each. the first is a hidden column that is the key, and the second lists either a color, size, or quote. i'm trying to set it up so that the user selects a color, size, or quote, and then populate another table with the respective keys, not the texdt the user selected.

I can't figure out how to query for the hidden fields in the combo box, the keys. When i try to run the query i get type mismatch, which I believe is because I'm querying the text the user selected, instead of the key.

if you can offer any help i'd appreciate it. if you need more info i tried to give it below, otherwise ask and i'll let you know.

Thanks again,
mike

I have 4 tables:
tshirt, color, size, and quote

the color, size and quote tables all have two columns, one acting as a key or ID, and the other with the appropriate
text.

the tshirt table has a row for a key or ID also, and then columns for color, size, and quote. the way i understand it the keys from the color, size, and quote tables need to be foreign keys in the tshirt table. so therefore they are all numbers.
 
Make sure your hidden column is the bound column in each of the combo boxes. The bound column's value becomes the value of the control when a choice is made.

If you already have the bound column set correctly, I need some more explanation. You talk about running a query, that apparently is referring to the combo box values. What is the SQL for this query?

You can check the value of a combo box from the Debug Window (Immediate Window in Access 2000). Just type something like this:
?Forms!<form name>!<combo box name>
If you get a text value, the bound column isn't what you wanted. Tell me in that case what the combo box's RowSource and BoundColumn properties are set to. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top