Duplicate Field Names

R

.:RoKsTaR:.

How do I get Access to allow me to have to fields with the same name? One of
my junction tables relates 2 things from the same table and I need to have
the fields labeled the same.

Cheers!
 
A

Allen Browne

You cannot have 2 fields with the same name in the same table.
The fields don't need the same name for you to create relations to other
tables.

For example, say you have an Employee table, and a junction table to record
who reports to whom when. The junction table would have fields:
- EmployeeID relates to Employee.EmployeeID
- SupervisorID relates to Employee.EmployeeID
- StartDate when this employee starts to report to this supervisor.

The idea is that, even though EmployeeID and SupervisorID both relate to the
same field of the Employee table, they have different names in this junction
table.
 
R

.:RoKsTaR:.

Thanks Allen :)

So how would I work in my case? I need to establish a relationship between
two or more people in my people table.

My people table is simple:

People - ID, Firstname, Lastname

I'm relating the 2 or more in this table:

Guardian - ID, Peopleid, peopleid, relationship, isprimary

Cheers!
 
G

Gina Whipp

That table is set up like an Excel spreadsheet, so in your case that would
not work... Your table should be set up like this...

Guardian - ID
Peopleid
relationship
isprimary

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Thanks Allen :)

So how would I work in my case? I need to establish a relationship between
two or more people in my people table.

My people table is simple:

People - ID, Firstname, Lastname

I'm relating the 2 or more in this table:

Guardian - ID, Peopleid, peopleid, relationship, isprimary

Cheers!
 
A

Allen Browne

Take a look at this article:
People in households and companies - modelling human relationships
at:
http://allenbrowne.com/AppHuman.html

Everyone (children, guardians, etc) goes into tblClient.
For each grouping, you then create a record in tblGroup.
Then tblGroupClient has a record for each person in the group.
 
R

.:RoKsTaR:.

Ok, I sort of understand that, but am still a bit hazy. Could you explain
why this won't work? right now I have a student table to take the peopleid
and associate it with a studentid. Then I have a gaurdian table to associate
a persion as a gaurdian and then show the relationship to a particular
student.

address - addressid, address, city, province, postalcode
attendance – attendanceid, peopleid, lessondate, lessonstatus, lessonnotes
phone- phoneid, phonenum, extension, phlocation
email - emailid email, emailLocation, isprimary
webservice – webserviceid, username, service
people – peopleid, firstname, lastname
products – productid, producttype, productdesc, price

student – id, peopleid, lessonday, gender, DOB, iscurrent
guardian – id, peopleid1, peopleid2, relationship, isprimary

people_address – id, peopleid, addressid
people_phone – id, peopleid, phoneid
people_email – id, peopleid, emailed
people_webservice – id, peopleid, webserviceid

The deeper I get in this, the more I get confused ;)
 
A

Allen Browne

So you have a Student table and a Guardian table.
One student can have multiple guardians?
One guardian can have multiple students.

The simplest solution would therefore be to create a GuardianStudent table
with fields:
- GuardianID relates to Guardian.GuardianID
- StudentID relates to Student.StudentID

If a guardian has 3 students, they have 3 records in this table.
If a student has 2 guardians, they have 2 records in this table.
 
R

.:RoKsTaR:.

Ok, i think that makes sense now :) So I need to keep what I have, and drop
the extra people id in the guardian table. Then I need to add the
guardianstudent table to relate the people in each?

I hope I got that right ;)

Cheers!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top