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!

retrieve data from hidden column in combobox

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.
 
Hi Mike,

You can do this by using the columns property of the combobox.

Look in the Row Source property of your combobox (the SQL statement)

so if your combobox Row Source is something like:

SELECT [tshirt].[ID], [tshirt].[tshirtname], FROM .......

you can get the id by

me.combo1.column(1)

just set the BoundColumn property to 2 so that names are showing instead of numbers

hope it helps
 
Make the bound column column one and then you can just refer to the control and you'll get the value in that first, hidden column.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top