jmoyer
04-27-2000, 08:33 PM
I have a table called Students where the primary key is SSN. I have several other tables (ie Assignment #1, Assignment#2, etc.) where the primary keys are the SSN. I have created a form for Students but I would like to know how (if it possible, I am desperate) with one form to have all the SSN fields in all the tables updated.
I.E when I add a new student in my student table through my Student form, I would like the SSN to be added to my different tables automatically although other information has not been inputed. I would love anyones suggestion. Thank you in advance
Deb in LA
04-28-2000, 09:09 AM
Think perhaps your assignment tables need a diff primary key. The ssn primary key field in all of your assignment tables should be foreign key fields which link to the student table via the ssn number primary key field in the student table. The primary key field in the assignment tables could just be autonumber fields-but need to be unique.
example:
tblAssignment1
--------------
A1ID (autonumber--primary key)
A1StudentID (foreign key which links to tblStudents StudSSN)
A1Topic (a text field)
A1Grade (a text field)
tblStudents
------------
StudSSN (unique field--primary key)
StudFName (a text field)
STudLName (a text field)
After this is done, establish your relationships between your tables and use ref integrity cascading deletes/updates.
Hope this helps.
Deb
Pat Hartman
04-30-2000, 06:20 PM
FYI, this is not a legal use of SSN. SSN may be stored as information in certain types of systems (this may or may not be one of them). But, in any event must not be used as the primary key. Although most people have SSN's (citizens at least), the US is not yet a police state and individuals are not required to obtain an SSN unless they have income which must be reported for tax purposes. They are also not required to supply their SSN except for express purposes.
jmoyer
04-30-2000, 07:24 PM
Thank you for letting me know. I was not aware of that fact.