I'm understanding it now. I'm ready to populate some data into my
tables
to
see how it works. Since there is a MaterialType in both tables do I
enter
the
data in both tables or just the MaterialType Table?
:
Absolutely! That's why you can't "associate" your Sizes data to your
MaterialType data in a query.
But, even better than using MaterialType, would be to create a unique
Material Type Identifier "key field" like [MaterialID] in the
MaterialType
table. Make this field an Autonumber field.
Your Sizes table should also have a MaterialID field (LongInteger),
and
the
2 tables should be related via their MaterialID fields. Use
Relationships
to set up Referential Integrity and Cascading and a Left Join between
the
newly designed tables.
If you haven't done this, and have already entered data in both
tables, I
would delete all the entries in both tables, follow the table redesign
above, and set up the relationships.
Now... a main form based on MaterialType with a subform based on Sizes
would
allow you to enter a MaterialType, and multiple Sizes associated with
that
Type.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
message Thanks for the help Al. One quick question before I start this. Does
the
MaterialType need to be in both tables?
:
If MaterialType to Sizes is a One to Many relationship...
Include both tables in your query, and join them with a Left Outer
Join,
using the key field (probably MaterialType) from each table.
(Show all records in MaterialType, and only those in Sizes that
match)
Type Size
Steel 4
Steel 8
Steel 10
Iron 3
Iron 5 etc....
Re: your second question...
Use 2 combo boxes, cboMaterialType and cboSize.
Populate cboMaterialType from the MaterialType table.
Populate cboSizes with a query just like the one above.
However, this time, we'll place the following criteria for the
MaterialType
field...
=Forms!frmYourFormName!cboMaterialType
Use the AfterUpdate event of cboMaterialType to Requery cboSizes,
so
they
always be in "synch" if cboMaterialType should ever change.
The choices listed in cboSizes will be filtered by the MaterialType
you
selected in cboMaterialType.
Ex. If you selected Steel, (using sample data above) only Sizes 4,
8,
10
should be available for selection.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
in
message I'm not sure how to create this query and it's probably pretty
simple
but
I
can't seem to figure it out. I have 1 table that has all my
"MaterialTypes".
Another table that has all my "Sizes" for each material type. How
do
I
create
a query that will list all my materials and the sizes for each
material
type?
The next step is that I want to create a form that will allow me
to
choose
the material type and then choose the size within that specific
material
type. When I choose the material type I only want the sizes to be
shown
as
choices for that material type. I'm assuming that both of these
controls
will
be combo boxes on the form. Can anyone help walk me through this?