Icehousman2
Registered User.
- Local time
- Today, 13:56
- Joined
- May 12, 2004
- Messages
- 45
Ok, I have a problem. I am creating a customer database, with the tables tblRep, tblAgent, and tblOffice. Each agent is assigned to one rep and one office. However, each office can have more then one rep and each rep may have more then one office. Now after saying that, in general an office will only have one rep. However, in some cases an agent from a particular rep will be related to an office that belongs to another rep, hence the many-to-many relationship. When this happens, this is considered an exception and I need to track this. So, I tried to create a junction table called tblException that included all the primary keys from the three main tables, and an extra field ‘exception’. However, when I try and create a new office I am unable to relate this to the rep table, because I do not have the agentID to create a record in the table tblException. The agent may or may not be added at a later date. So I have a problem. It seems to me that I have this set up wrong. Anybody have some advice? I’ve included a screen shot of the relationships. And if you are wondering officecode is part of the primary key in both the tblagent and tbloffice because of updatability between separate instances of the database.