Relations driving me crazy

pookie62

Registered User.
Local time
Today, 03:54
Joined
Jan 16, 2005
Messages
47
Hi,
I'm trying to build a mdb which holds customer details, which insurance they have, who sold them this and which Insurance company provided this.
The relations I have to make are driving me nuts !
When I try to enter a new customer in a Form, there is a advisor added, the package the customer wants is added. But this shouldn't happen for the advisor and the package allready exists !

Who can help me with the proper relations ?
Attached is screendump of the current relations.

Thanks a lot !
 

Attachments

  • relations.gif
    relations.gif
    36.8 KB · Views: 186
PLz!?!? Anyone want to help me out ?
I almost got no hairs left to pull out...
 
Pookie, relationships always give me trouble too. (Oh, wait, you were talking about TABLE relationships....)

I have to give you my generic "object model" advice. Start by identifying entities that can exist in isolation. Each such object becomes the focus of a table.

I see customers, policies, agents, and underwriting companies (?). Four tables. Each has some prime key (PK). These PKs will become foreign keys (FK) in other tables. When table A's PK becomes an FK in table B, it is table B that references table A.

I'm thinking likely that your customer would be autonumbered since names are not likely to be unique. The customer table will tell you data unique to each of your customers. The PK of the table might also double up as a customer number, with the understanding that if it is an autonumber, you are NOT going to have contiguously numbered customers.

Policies? If policy numbers are inherently unique, there is your PK. If not, autonumber. (But I've yet to see an insurance policy that didn't have a number of its own...)

Agents? If they have some unique insurance industry identifying number, there is your possible PK. Otherwise, autonumber. I'm thinking about medical doctors who have special numbers that register them with the State of Louisiana Board of Medicine, so that prescription fraud/abuse can be tracked. That kind of numbering is what I mean by industry identifying number.

Underwriters? If there is an industry-wide identifying number,that could be your PK. If not, autonumber.

OK, lets go back and look a relationships.

If a customer can have more than one policy, you put the customer number as FK in the policy entries. This is a many/one//policy/customer case. BUT if a single policy can also cover more than one customer then you need something called a junction table between the two. The Search function of the forum will help you there. A junction table can be as simple as two FKs and nothing else. Also, a junction table inherently has two many/one relationships - one each for the two tables joined by the junction table.

If the policy can only be issued by a single agent, the issuing agent's PK becomes FK in the policy table. If the policy can be issued jointly, you have another junction table. Same logic as before.

If the policy can only be underwritten by a single company, the issuing company' PK becomes a FK in the policy table. If a single policy can be jointly underwritten, you have another junction table on your hands.

If you have more entities than this, refer to the above for the kinds of questions you ask to set up the relationships.
 
Hi Doc Man,
Thanks for your reply, I've been reading up on junction tables, but it's dazzling me a bit..
Situation is:
Each customer can have multiple policies, sold by one advisor.
Each policy is owned by a company.
A company can have multiple policies

I want to have a form where I can add a new customer, together with the policy he bought, which company and which advisor sold it to him.
 
Ok let me have a styab at this (I am in insurance)
Right Client (Customer) (One table)
Policies (another Table ) liked by
Underwriter/insurance company
Selling agent (handlier)

so on your client screen you will need a sub form (OK with this?)
this subform needs to be continous(probably) and int he subform you need it to hold the following
Policy
U/w or Company
and Handlier

it is unclear as to whether policy, U/W are going to be in a table of there own or freeform text
handlier i presume will be your companies handlier not another handlier from another company ?

if so table on handlier - combo box tied to qry (not table)

you subform
you need a table set up for the follow
Autoid
main client /customer (id)
Policy
U/w
and handlier

right you new table can have customer number 5 as many times as required (lets say 7) let do a little demo
autoid no
mainclientno
policy
U/w
handleir

autono 1
Mainclientno 5
policy ABC Car insurance
U/writer ABC
Handlier - Big Bad Dave

autono 2
Clientno 5
policy household
U/wrter hicup insurnace
handlier Sad sally

etc

autono does itself
client no will get the data from the main form
policy - free from type
U/writer - free form type
and Handlier from table

now if the policy and U/writer are going to be tied to a table this needs a slightly diffrent approach

but does the above help
 
Have a look at the attached zip d/base (Access 2000)
this is slopy - but I think this is probably going down the right route

I have not got it adding the customer id into the subform(this is do-able) so at present you add their number in (check the samples on how to do this )
 

Attachments

Hi GaryPanic,
Thanks man !
I'll have a look at your sample.
 
if you get stuck - ping me as a message and I have a better look (I cannot open zips here at work -but can forward onto my other account which allows me to download- but response willbe 1 day out)
 
if you get stuck - ping me as a message and I have a better look (I cannot open zips here at work -but can forward onto my other account which allows me to download- but response willbe 1 day out)

Send you a PB
 

Users who are viewing this thread

Back
Top Bottom