Referential integrity - help required (1 Viewer)

mctaguma

Registered User.
Local time
Today, 20:23
Joined
Dec 30, 2006
Messages
18
Hi,

I'm making a database with frontend and backend.

I have one form, called frmHeader, for PersonalName data. (shown in screenshot080.jpg)

you click achievements, to get another form to enter achievement data, based on the member's section.

How should i establish referential integrity?? (relationships shown in screenshot079.jpg)

Any help appreciated,

Matthew
 

Attachments

  • screenshot079.jpg
    screenshot079.jpg
    92.5 KB · Views: 218
  • screenshot080.jpg
    screenshot080.jpg
    65.1 KB · Views: 215

MarkK

bit cruncher
Local time
Today, 01:23
Joined
Mar 17, 2004
Messages
8,186
Right click on a table relationship in the relationship viewer. Click "Edit Relationship", select the check box to enforce RI. The relationships in your JPG have RI enforced, since they are bold and display the "1" and "infinity" symbols.
 

boblarson

Smeghead
Local time
Today, 01:23
Joined
Jan 12, 2001
Messages
32,059
I would highly suggest that you rename your ID fields for each table so that it is easier to tell which ID you are working with. I see every table with ID in it.
 

mctaguma

Registered User.
Local time
Today, 20:23
Joined
Dec 30, 2006
Messages
18
Relationships - Referential Integrity

boblarson said:
I would highly suggest that you rename your ID fields for each table so that it is easier to tell which ID you are working with. I see every table with ID in it.

Is this better?
 

Attachments

  • screenshot079.jpg
    screenshot079.jpg
    29 KB · Views: 194

boblarson

Smeghead
Local time
Today, 01:23
Joined
Jan 12, 2001
Messages
32,059
No, not quite. I'm not totally sure about what some of the fields are and trying to accomplish, but this should give you a better idea.

 

mctaguma

Registered User.
Local time
Today, 20:23
Joined
Dec 30, 2006
Messages
18
boblarson said:
No, not quite. I'm not totally sure about what some of the fields are and trying to accomplish, but this should give you a better idea.

Thank-you!!! :eek: :D

Here it is now! :)



I added to your Reputation ;)

Matthew
 

boblarson

Smeghead
Local time
Today, 01:23
Joined
Jan 12, 2001
Messages
32,059
I suggest, if possible, to rename your foreign key fields the same name as they are primary keys in the table that they are primary keys in. It makes it WAY easier to know what is what when you look at it. For example, if you look at my sample I have PersonalNID, which is the primary key in the Persons table named the same in each table in which it is the foreign key. You don't have to do it that way but I'll tell you, from lots of experience, it will save you (and whomever follows after you) loads of time and effort when you come back to it (after not working with it after several months) and need to know what is what.
 

Users who are viewing this thread

Top Bottom