View Single Post
  #4  
Old April 23rd, 2010, 11:24 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default subforms and relationships getting #Name? error

On Fri, 23 Apr 2010 13:57:01 -0700, mholt261
wrote:

I need to keep track of individuals (name, dob, address, employment...) I
have made tables for this information. Each individual is given a unique
number (CID). Instead of using a primary key number I use the CID #. (Do I
still have to use a primary key number in a table?)


Sounds like the CID *is* (or should be) the primary key. Microsoft tries to
suggest that "Primary Key" is synonymous with "Autonumber" but that is not the
case; a primary key must be unique within the table, and should be stable and
short, but it can be a Number, Text, even a date. I'm guessing that yours
would be in a Text field.

There is information that
changes with each individual that I need to track, such as address,
employment. I have been told to use the unique number (CID in my case) in the
relationships to keep the information connected to the individual. I want to
enter an individual's address, employment information,etc. in a separate
table or form (as this info changes periodically) and still keep track of the
previous entries. I hope this clarifies my issues.
Thanks


In that case the CID would be a *foreign key* in these related tables (not the
primary key). Your table of (say) addresses would have an AddressID primary
key; this could very well be an autonumber. It would also have a CID field of
the same datatype and size as the CID of the table of individuals, to be used
as a foreign key.

For data entry you could use a form based on the table of individuals, with
one or more Subforms based on the related tables, using CID as the
Master/Child Link Field.

See the resources at:

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/acc...resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

Roger Carlson's tutorials, samples and tips:
http://www.rogersaccesslibrary.com/

A free tutorial written by Crystal:
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials

--

John W. Vinson [MVP]