View Single Post
  #3  
Old April 30th, 2010, 08:47 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default referential integrity and lookup

On Thu, 29 Apr 2010 11:48:04 -0700, buggirl
wrote:

Hi all,

I want to enforce referential integrity between two fields in two separate
tables:

tbl FishTaxonomy (includes the full name, common name, and abbreviated
scientific name)
tb Fish (includes the abbreviated scientific name, length of each fish, sex,
etc.)

The name used in tbl Fish is from a lookup of tbl FishTaxonomy. However,
when I look at my relationships, there is no link between these two tables. I
try to join these fields and enforce referential integrity (I only want to
have one taxonomic description for each fish species, but lots of individuals
of each species). I get this error message:


Is the "abbreviated scientific name" unique in tblFishTaxonomy - i.e. if you
have an entry for STrutta in one record, is that the ONLY record with that
name? If so you could make the abbreviated name the Primary Key of
tblFishTaxonomy. I'd be inclined to use the ITIS TSN (http://www.itis.gov)
or some other widely accepted taxonomic unique key, though! No point in
reinventing a tool that already exists!

In any case you need either a Primary Key or (bad second best) a unique index
as the linking field.

I'd also strongly urge that you examine the use of Lookup Fields in your
tblFish: see http://www.mvps.org/access/lookupfields.htm for a critique of
what many consider a misfeature.
--

John W. Vinson [MVP]