display when true

  • Thread starter Thread starter Jimbo
  • Start date Start date
J

Jimbo

Hello everyone. I have an access database for a auto dealership. One of
the tables is called 'Features'

Air Condition - Yes/No value option
Power Steering - "
Power Windows - "
Cruise Control - "

What I want to do is run a query that will only pull out the fields that
have a "True" value. So when I display the specific car, it will list the
features that this car has by running the query.
 
If I understand correctly, your tblFeatures has one field for each feature.
This is a standard table design ... for a spreadsheet. Access is a
relational database, and you won't be able to (easily) use its strengths and
features unless you design your data relationally. Check into the topic of
"normalization".

One of the problems with the table design you describe is that you have to
keep modifying the table (and any queries, reports, code, macros, etc. that
refer to it) when features change (added, removed).

Hints:

One table to hold feature-only information (not which vehicle has the
features) --
tlkpFeature
FeatureID
FeatureName

This table gives you a way to add new features at any time, without needing
to modify the rest of your database.

One table that holds a single record for each valid combination of vehicle
and feature -- if a vehicle only has one feature, it will only have one row.
If a vehicle has 30 features, it will have 30 rows in this table --
trelVehicleFeature
VehicleFeatureID
VehicleID
FeatureID

With this design, for a specific vehicle (using VehicleID), you can list all
the features (FeatureID) associated with it.
 
Back
Top