View Single Post
  #8  
Old January 11th, 2010, 06:28 PM posted to microsoft.public.access.tablesdbdesign
Pamela
external usenet poster
 
Posts: 193
Default Best way to design tables for cascading on my form

Thanks so much, Steve, for that suggestion and I followed your instructions.
I don't see, however, where/how the VehType & the Parts get matched. I
believe the 3rd table you had me create (I already had the first 2) is a
junction table for a many-to-many relationship (each veh has many parts, each
part has many vehs). Maybe I'm going down the wrong path here in my thinking
but what I've learned is that queries with more than 3 tables such as the one
you described cannot be updated so, again, how would I match VehType w/
Parts???
Thanks so much for helping me through this!!
Pamela

"Steve" wrote:

First you need tables like the following:
TblVehType
VehTypeID
Vehtype

TblPart
PartID
Part

TblVehTypePart
VehTypePartID
VehTypeID
PartID

Then create a query that includes the three above tables. The columns in the
query need to be:
VehTypePartID from TblVehTypePart
Part from TblPart
VehTypeID from TblVehType

Set Part to sort ascending. Set the criteria for VehTypeID to:
Forms!NameOfYourForm!cboVehType

Put the following code in the AfterUpdate event of cboVehType:
Me!NameOfTheListbox.Requery

Steve


"Pamela" wrote in message
...
My company inspects damaged cars for insurance purposes. Up to now,
(relating to this issue) I've had tblDamageArea populate a list box on my
form where the user can select the various parts of the car that were
damaged. I've had this list include parts for multiple kinds of cars and
I'd
like to make this list cascade to include only those parts relevant to the
car type inspected.

I've created a tblVehType to separate Sedan, Coupe, 4DoorTruck, SUV, etc.
which populates a cbo on my form where the user will select the type which
will then be used as the criteria for cascading the list box.

Before that, I created tblParts w/ the Parts but then also had each
vehicle
type listed out w/ Yes/No boxes where I then selected which parts go with
which veh. This is where I'm really needing help. I know this isn't the
best way to do it but can't figure out how else at this point to use the
tblVehType and connect the related parts to each veh.

Many of the parts are the same for all of the vehicles -- for instance the
front end parts - they all have bumpers, fenders, hoods, windshields,
etc.
but the doors (2 vs. 4), quarters (or beds), and rear ends all vary. I
imagine that I'll use a query to put them all together for the list box
but
what is the easiest and best way to set up my tables & dictate which parts
go
with which vehs?

Thanks for your help!

Pamela



.