View Full Version : relationship implementaion problem


blink182_joel
04-21-2007, 05:23 AM
Hi i'm new to Access and Forums, i have a big problem ... i have 10 tables, and i can't seem to get the correct relationships, even though they're all 1-to-many; if i enter data in the tables it just throws up error messages saying "you can not add or change a record, because a related record is required in table **** "

INSTRUCTOR
Instructor Name (pk)
Courses an instructor may teach
Courses an instructor specialises in

CLIENT
client name
client employer
client address
client phone number
client ID(pk)

MODULE
Module Name
Module ID(pk)
Comments

COURSE
Course Name
Course Reference Number (pk)
Course Duration
Instructor Allocated to course

VENUE
Name of Venue
Venue Address
Date of Venue
Venue ID (pk)

BOOKING
Booking ID (pk)
Accommodation
Meals
Equipment


i think i need foreign keys in the following tables but im completely unsure

COURSE/INSTRUCTOR
Course Reference Number (pk)
Instructor

COURSE/CLIENT
Client ID (pk)
Client Name
Course Reference Number

COURSE/MODULE
Module ID (pk)
Module Name
Course Reference Number

COURSE/BOOKING
Booking ID (pk)
Accommodation
Course Reference Number

I think i'm on my own here haven't got a clue how to sort it out.

Joe

The_Doc_Man
04-21-2007, 08:07 PM
"you can not add or change a record, because a related record is required in table ****

A sure sign that you are entering data in a child table before you enter data in a parent table AND relational integrity has been defined. In Access as in real life, parents must precede their children.

Two possible issues could apply that would produce the same exact error.

1. You could really be adding data to a table. If there is a relational integrity relationship, you cannot add data to the many end of the relationship until the one end is populated.

2. You are adding records to what you believe to be the parent but you have the relationships set up backwards.