View Single Post
  #2  
Old January 13th, 2010, 07:11 PM posted to microsoft.public.access.tablesdbdesign
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default linking tables for maximum efficiency

This part will cause you grief:

Analysis1
Analysis2
Analysis3
Analysis4

What happens when someone decides to add a 5th Analysis? All your forms,
reports, and queried based on this table will need to be modified.

You need this table to be different and add another table.

tbl FishAnalysis:
FishAnalysisPK (every table needs a PK even if just an autonumber)
FishPK FK to Fish
AnalysisPK (FK to the Analysis table!)
ChemoResult

tbl Analysis
AnalysisPK
AnalysisName
AnalysisNotes

This way you can add more chemical analysis in the future. Queries will be
much simpler to although you'll need to join in an extra table and remember
to do things like left or right joins to see all results.

BTW: An old buddy of mine, Jim Widlak, does work in a field like your
database suggests in Tennessee. A very tall guy and about 58 years old. Know
him?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"buggirl" wrote:

Hi,

I am trying to build two tables containing information about fish that we
have collected:

tbl Fish:
FishPK (one for each individual fish; autonumber)
CollectionPK (links to tbl Collection which contains information about where
and when we collected the fish)
FishName
FishAge
FishSex
FishLength

tbl FishAnalysis:
FishPK
Analysis1
Analysis2
Analysis3
Analysis4

The chemical analyses are only performed on a subset of the entire fish
collection.

I am pretty happy with this design, but am open to suggestions! In
particular, I want to know if this design allows me to:

1. build a query to find the individual fish that have (or have not) been
used for chemical analyses

2. build a form for entering results of the analyses - when I receive the
data, it looks like this
Collection ID (not PK)
FishName
Analysis1
Analysis2
Analysis3
Analysis4
- which means that I have to collect data from two separate tables before
adding the new results to tbl FishAnalysis. How do I build a form to simplify
this process? And is my design correct to enable my form?

I would appreciate any input!

Thanks,

buggirl