Hi Randy,
Well, I have a solution if you are looking to do this in a
client-side form in Access2002. Currently, I've got a post
on looking to find out how to do in on a DAP. Help!!
But back to your problem. Create one unbound combobox with
your 20 or so different sizes. Create another combobox
field - or a single value unbound field if the return
value "per size" is just one value - on the same form that
has as it's rowsourcetype as "table/query" make its
rowsource the name of a query that you have already
created to lookup a value based on a particular size. Then
in the "After Update" event of the first field (the one
with the sizes) enter this in the sub:
Me!ComboBoxFieldName = Null
Me!ComboBoxFieldName.Requery
where "ComboBoxFieldName" is the name of the field or
combobox that the result(s) are going to be returned in.
Then create your query in querybuilder using something
that, in my database, looks like this:
SELECT Messages.Message ' Comment: ' "Message" is the
table column name containing the values that you want
returned based on the size selected in the other combobox
FROM MessageTypes INNER JOIN Messages ON
MessageTypes.MessageTypeID=Messages.MessageTypeID
WHERE ((MessageTypes.MessageType=forms!MainForm!combo34));
In this example, "MainForm" is the name of the form
and "combo24" is the name of the combobox with all
the "key values" in it. In yours this would be where you
put the sizes. "Messages" is the table with all the
message values in it along with their individual id's and
the id's (not names) of their "types". And "MessageTypes"
is the table name of the table where all the names and
ID's of message types are stored. That's why I had to do
the inner join. To match the values in two different
tables using a common key (the "messagetypeid" value).
Hope this has been helpful. It's even easier if you are
just trying to get one value per size and everything is in
one table:
Select tablename.lookupfieldvalue
from tablename
where tablename.keyfieldvalue = forms!formname!
comboboxname;
Take care,
Tom