View Full Version : Relationships


NNothard
06-23-2006, 05:25 AM
Hi I am having trouble with my database and I think it stems from the way that I have set up the tables and relationships.
The problem I am having is that I split my clients into two types - private and company clients.
However I am now stuck as to how to query both sets of data. I want the user to be able to search the database by Card Number or by Name and to search both sets of data and then open the form relating to Private or Company depending on the type of client.
I can do this for each one seperately but cannot for the life of me understand how to combine it.
I feel that another problem is that a Card Number should be in a seperate table as each card issued needs to be unique and I can't do this when it is split into two tables.
I have put a screen shot of the relationships up, does anyone have any suggestions how I can bring these two sets of data together, or do I need to redesign?

KenHigg
06-23-2006, 05:35 AM
I think I would put all basic, common client data in one client table. Then have a seprate table that contains data unique to each client type... Say a 'Private Client Info' table and a 'Company Client Info' table...

???

Pat Hartman
06-24-2006, 08:29 PM
There are other active threads on this topic plus historical threads. You will probably find that creating an entity table as Ken suggested is the best bet. If you truly have many different fields for private and company entities, then create two tables to hold that data and define 1-1 relationships between them and the entity table. Whenever you need a foreign key, use the EntityID. NEVER use the private or company IDs.