Having a Problem With Relational Integrity

Alex.Wood101

New member
Local time
Yesterday, 20:30
Joined
May 27, 2016
Messages
2
Hey guys, I'm doing a college assessment right now and I'm having a few problems inputting data for a foreign key.

So, I'm basically making a database for hardware problems. One of the tables is called Hardware Problems Log. In this table an employee at this company would be able to write a report stating problems with a hardware at a certain time and place.

Each Employee has a ID in another table called Employee, the ID is an Auto Number. I've made a column in the Hardware Problems log called Employee ID (it's the Number data type), I've put the both of them in a one-to-many relationship.

Anyway here's the problem: Whenever I try to input a Employee ID, that is from the Employee table, into the Hardware problems log I get an error message, that says: "You cannot add or change a record because a related record is required in Table 'Employee Details'.

I understand that, but I do have a record in the other table. I'm really confused by this. Any help would be greatly appreciated. Thank you!
 
Have you studied/researched Normalization?
Do you understand Primary Key and Foreign Key?

A common analogy for the issue you are encountering is:

I want to add a Child to this family. However, there are no Parents defined.
You must have a Parent before you have a Child (record).
 
When do you get the error message, when you start to type in the ID, or when you move to another control or record?
 
Hi thank you for replying, both of you.

The error was popping up after I finished the column and I had research normalization and understood it, but thank you for the help, jdraw.

I have figured out the problem, it was a silly mistake by me, as I'm new to access. My IDs for employee begin with 2 and have five numbers, increasing by increments of 1. When typing in these IDs, apparently I do not need to type out the full ID, just the number it increases by.

I didn't realize this at all until I selected an ID field and see that the number 2 at the beginning was not shown.

I hope this problem I had might be useful to any other access novice, like myself, in the future.
 

Users who are viewing this thread

Back
Top Bottom