By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,433 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

Relationship Problem

P: 1
Hello I trying to learn access I am actually taking a class for I had to do an assignment but I am stuck in creating a relationship I get error and don't know how to fix them. Would someone show me what I doing wrong thanks. Primary key on DepartmentName
I got in table one DepartmentName, Budgetcode, Officenumber, and phone
Primary key on Employee Number
On the other one EmployeeNumber, FirstName, LastName, Department, phone, Email.

I keep getting Error 3201 you cannot add or change a record because a related record is required in table (name)
Can someone tell how can I create a relationship
Jan 26 '17 #1
Share this Question
Share on Google+
2 Replies


jforbes
Expert 100+
P: 1,107
I wouldn't ignore the error you are getting. It's trying to tell you that you can't create the Relationship on the Tables since there is Data in it that would not satisfy the Relationship you are attempting to create. Like a Department in the Employees Table that doesn't exist in the Department Table. (I'm guessing that is the relationship you are attempting to make)

To create your Relationship, you have to
  • either get your Data to line up. Make sure Every Single Department in your Employee Table exists in your Department Table.
  • or delete your data, create your relationship, and add your data back.
Jan 26 '17 #2

NeoPa
Expert Mod 15k+
P: 31,261
Hi Erik.

We have to be very careful not to do your assignment for you, nor be understood to have done so. Nevertheless, with a clearly specified question we can give helpful pointers.

What is unclear to me is why the error message indicates you're trying to add a new record (Presumably for an Employee of a Department whose record you haven't added yet.) yet the question appears to be about how to create the relationship.

Access is an incredibly powerful tool, but be very clear on this point - Precision and accuracy are paramount if you're to make any progress. Wooly thinking and a 'sort of general' understanding of what you're trying to achieve will get you nowhere very quickly.

Specifying your question clearly and accurately will have two immediate benefits :
  1. You will understand the situation more clearly yourself. Once you put that effort in it will help. It still does for me when I'm struggling.
  2. It will allow experts who wish to help a much better chance of providing helpful comments.

Let us know if you still have issues after reading these posts.
Jan 27 '17 #3

Post your reply

Sign in to post your reply or Sign up for a free account.