| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
|||
|
|||
|
Table design for simple CONTACTS database
Hello All,
At work we have a large and messy Contacts list so I decided to set one up using a database. At present I have 3 tables:- Companies (custID,companyname,address,etc) People (nameID,firstname,middlename,lastname,custID) Phones (phoneID,phonetype,areacode,number,?????) My problem is this, Some of the phone nos belong to the individuals and some belong to the company. If a person is replaced at a company I need to reasign the company phone nos to the new person whilst retaining the individuals and their personal phone nos. If a company is deleted I need to delete only the company phone nos. and if a person moves within the company I want the company nos to reasign to the new replacement but keep the personal nos of the individual. Now I see its going to be more complex than I thought. Can anyone help me with the table layout and links. (nb this is only a simple database relating a person to a company without using departments etc.) Its main use is to provide phone nos names and addresses quickly. Many Thanks Peter |
| Sponsored Links |
|
#2
|
||||
|
||||
|
Access comes with a Contacts Management sample db. New>General Templates...
__________________
(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 - WinXP Pro, Win7Please post back to this Forum so all may benefit. Teaching is not filling a bucket but lighting a fire. |
|
#3
|
|||
|
|||
|
The Contacts management template doesn't solve this problem. It is just a very simple structure. You need to add a Role table that is used to define the use of a particular phone number. Then you need to add two relation tables. One to join company to phones and a second to join people to phones. Each record in these relation tables also contains a role code so you know what the number is used for. You can't make a standard 1-many relationship between phones and people/companies because in your application, you have not put people and companies in the same table. Therefore, in order to enforce referential integrity (which is a must), you need to use two separate relation tables. If a phone can only be assigned to one company or one person at a time, add a unique index on PhoneID to both relation tables. This will make the many-to-many relationship act like a 1-many.
__________________
Bridge Players Still Know All the Tricks |
|
#4
|
|||
|
|||
|
Thanks for The help Pat, Its a little over my head at this point (my 1st database) but I want to go through the hoop doing this properly so that when I've finished I'll have a good idea about dealing with real world solutions. I caught on with the idea of a usage table and have (hopefully) attached a screenshot of the table relations using access 2000. Your views on its workability would be appreciated. The basic usage is as follows.
1) to click on a company and get a list of contact names, click on one of the names and get that persons Office, DDI, FAX, and mobile nos. etc. also the company address so we can cut and past it into a delivery docket etc. 2) To click on a contact name to get the company name and address and the contacts phone nos etc for the same reason. 3) to resolve the issues of a contact leaving or moving to a different position and a replacement inheritting the old Nos except the personal ones. At present I am dealing purely with the tables and their relationships. |
|
#5
|
|||
|
|||
|
Looks good to me.
__________________
Bridge Players Still Know All the Tricks |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Proper interface design and the database abstract rant | dt01pqt | General | 17 | 08-16-2004 07:43 AM |
| Whooa! Weird Database Design...Thoughts | Kevin_S | General | 14 | 03-10-2003 10:06 AM |
| Right click to enter datasheet mode | Autoeng | Forms | 14 | 02-19-2003 01:47 PM |