Table Fields

MRDosGuy

New member
Local time
Today, 17:58
Joined
Jul 2, 2002
Messages
8
Ok, I have one table that is a list of employees made as a master database. I've created another table that is about their security and I need to know how to make the second table reflect the first table. I want to be able to put all their names in it, and have the rest of their information appear in the second table, but I have no idea how to make this work. Any suggestions would be appreciated.
-Ben
 
What you want is a relationship between your tables

It sounds like the security table could have more than one entry for each person. If so, it will be a One-to-Many relationship. Here's how you implement that:

In youre new table, make sure you put a field in of compatible type to the EmployeeID (or whatever the unique identifier, Primary Key, is for your main table). If it is Autonumber there, make it Long Integer here. If it's Text, Text. This table gets its own Primary Key, but this is the field that tells it "this record is related to record XYZ123 on the main table." If it is a One-to-One relationship (you'll only have one Security entry for each person), then go ahead and make THIS field the Primary Key, No Duplicates.
Now go into Tools>Relationships from practically any window. Draw a line connecting the two matching fields in your tables. If you don't see your tables, right click on the blank space and select Show Table(s). The relationship should pop up and have either "One-to-Many" in the lower right, or "One-to-One". If it says "Indeterminate", you did something wrong.
Provided everything's going fine so far, check Referential Integrity and Cascade Update for the two records, and possibly Cascade Delete though I'd be careful about this one if you need to keep historical entries for auditing purposes.

Now you asked how to get all the info from the first table into the second. Use a query; drag both tables into it, (see the relationship again?), and draw down the fields you want. You'll see all fields without having to store them more than is necessary (i.e., once).


Make sense? If not, post back and we'll try again.
 
Thanks

Thanks for the advice. I'll try it tomorrow and see how it goes. If all goes well, then thanks again; if not, I'll have to see what I'm doing wrong.
-Ben
 

Users who are viewing this thread

Back
Top Bottom