Table design

  • Thread starter Thread starter Scott Viney
  • Start date Start date
S

Scott Viney

Gday All,

Not sure of the right way to go about this. I have created two tables one
for customers that are companies and one that is for customers that are ppl.
Then I have joined both these tables to a table called tblcustomers.

Is this the right way of thinking?

Because at them moment I have been thinking that I now have the same nearly
all the same field names in each. Like address and phone number, postcode
etc. So should I arrange them differently

The other thing is with this structure I dont know how to show them in a
form....for each customer record there should only be a company or a
person...not both.

Any help would be appreciated,
Scott
 
Try placing them in one table with a field to indicate if they are a person
or company. You may want to make the value of this field be 1 or 2. That
would allow you to use an Option Group on the form with two Radio Buttons,
one for Company and one for Person. The Option Group will automatically
limit the selection to one or the other. Set the Control Source of the
Option Group to the field created above. Option Groups return a number from
1 to the number of options in the group. Set the Default Value of the Group
to 1 or 2, as desired. If there are a couple of fields that you use for
company or person that you don't use for the other you could turn those
controls on and off on the form by changing their Enabled or Visible
property. This would need to be done in the form's Current event and the
option group's AfterUpdate event.
 
Thanks mate,

Ive combined the two tables to one and added a field for the type of
customer with radio buttons on my form. Just have to have a crack at doing
the coding for disenabling the fields I shouldnt be filled with each type.

Cheers,
Scott V
 
Back
Top