View Single Post
  #2  
Old April 29th, 2010, 08:12 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default referential integrity and lookup

When you described your two tables, you didn't indicate what field(s) you
are using as a primary key in each.

A primary key serves to identify each unique record (so if your "abbreviated
scientific name" field is truly unique, that seems like a good candidate).

Then, after your Taxonomy table has a primary key identified, you'll need to
have a corresponding "foreign" key in your Fish table. This field holds a
copy of the value that points back to the primary key in the related table.

It isn't entirely clear from your description, but I suspect that you have:

* a taxonomy (i.e., a naming table)
* a list of examples (i.e., specific instances, each with a unique
"parent" from the taxonomy table)

If this is accurate, you have a one-to-many (or parent-child) relationship.
If one Taxonomy record could have many Fish examples, you have this kind of
relationship.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.


"buggirl" wrote in message
...
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:

No unique index found for the referenced field of the primary table.

I'm assuming that tbl FishTaxonomy is the primary table.

Also, the Edit Relationships box lists the relationship as
'indeterminate'.

Eek. I think there is something wrong with my design!

Help?

Thanks,

buggirl