A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Relationship



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2010, 05:33 PM posted to microsoft.public.access.tablesdbdesign
PJ
external usenet poster
 
Posts: 265
Default Relationship

I created 5 Tables:

1)Office with Primary Key as auto number named Office ID
2)Marketer with Primary Key as auto number named Marketer ID
3)Currency with Primary Key as auto number named Currency ID
4)Client Name with Primary Key as auto number named Client ID
5)Client Ticket with Primary Key as auto number named Client Ticket ID

I have Client ID in each of the other 4 tables and Client is the
relationship by Client ID. When I test and add a new client it is not
showing up in the other tables. I do not think I set up the database design
correctly. Any suggestions??

Thank in advance.

  #2  
Old May 20th, 2010, 06:19 PM posted to microsoft.public.access.tablesdbdesign
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Relationship

The client will not show up automatically in the other tables and for a good
reason. You could have a new Customer that hasn't created an Order yet.
Therefore you don't want a record in the Orders table.

Now if you want Access to automatically create a matching record in another
table when needed, it will. You first need to create these relationships in
the Relationship Window. Enable Referiential Integrity (I don't usually like
Cascade Delete and if you are using Autonumbers for the PK, you shouldn't
need Cascade Update).

Next create a form based to the topmost table. In your description, Client
Name seems to be this table. Next use the subform wizard to create subforms
for the other 4 tables on your Client Name table. Then when you add an Office
to that Client Name, Access should insert the proper FK. You might want to
create a tab control to handle that many subforms.

Also make sure to get the relationships pointed in the right direction. Can
a Client have many Offices OR does an Office have many Clients? Very
important.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"PJ" wrote:

I created 5 Tables:

1)Office with Primary Key as auto number named Office ID
2)Marketer with Primary Key as auto number named Marketer ID
3)Currency with Primary Key as auto number named Currency ID
4)Client Name with Primary Key as auto number named Client ID
5)Client Ticket with Primary Key as auto number named Client Ticket ID

I have Client ID in each of the other 4 tables and Client is the
relationship by Client ID. When I test and add a new client it is not
showing up in the other tables. I do not think I set up the database design
correctly. Any suggestions??

Thank in advance.

  #3  
Old May 20th, 2010, 09:22 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Relationship

On Thu, 20 May 2010 09:33:01 -0700, PJ wrote:

I created 5 Tables:

1)Office with Primary Key as auto number named Office ID
2)Marketer with Primary Key as auto number named Marketer ID
3)Currency with Primary Key as auto number named Currency ID
4)Client Name with Primary Key as auto number named Client ID
5)Client Ticket with Primary Key as auto number named Client Ticket ID

I have Client ID in each of the other 4 tables and Client is the
relationship by Client ID. When I test and add a new client it is not
showing up in the other tables. I do not think I set up the database design
correctly. Any suggestions??


Access will NOT automagically create new records or field values in other
tables just because you add a new client. A relationship *prevents* the
addition of an invalid record; it doesn't (and needn't and shouldn't) create
empty placeholder records.

Doublecheck your logic, as well. If you put the ClientID field in the Office
table, that means that that office can service one, and only one, client;
similarly with Marketer; similarly with Currency. I doubt that is your intent!
If each Office can service many Clients, but each Client is served by only one
Office, then you need an OfficeID field in the Client table, not vice versa.
The foreign key goes in the "many" table, not in the "one".
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.