View Full Version : Multiple address for a Customer/Vendor


gots
05-06-2008, 05:56 AM
I am a newbie to Access and learning the same.

I am stuck in a problem and not able to get through. Please advice

I have made tables as below but am not able to get through the relationships an form for input of data

tblcustomers
- CustomerID - Autonumber - PK
- CustomerType
- BoutiqueType
- Customer Zone
- Customer Number
- Company
- FirstName
- LastName
- Phone1
- Phone2
- Fax
- Mobile
- Email
- notes

tbladdresstype
- Addresstype (eg: Billing, shipping, office, factory, godown, residence etc.)

tblcustomeraddress
- Street
- City
- Pin
- State
- Country
- Phone
- Fax

Now I want to have multiple address for each customer. Please let me know what all the fields to link in relationship and what type of relationship.

What fields to include on form frmCustomerDetails.

Thanks in advance

Dennisk
05-06-2008, 06:26 AM
Use the Customer ID in tblcustomeraddress as a foreign key. Set the field to required, no default value and index it. If you have a Customer Maintenance form place the address in a subform and link it (if you drag the form onto the the main form Access may correclty link it you. Then when you add an address the foreign key is automatically populated for you.

georgedwilkinson
05-06-2008, 11:57 AM
Unless you have many people at the same address. In that case, you would create a CustomerAddresses table with a foreign key from Customers and a foreign key from Addresses. Under such a scenario, when you change the address of any person at a certain address, it changes that address for all people at that address. This can cause some problems so use it with caution!

gots
05-06-2008, 08:22 PM
I have modified the tables as below,

tblcustomers
- CustomerID - Autonumber - PK
- CustomerType
- BoutiqueType
- Customer Zone
- Customer Number
- Company
- FirstName
- LastName
- Phone1
- Phone2
- Fax
- Mobile
- Email
- notes

tbladdresstype
- AddressTypeID - Autonumber - PK
- CustomerID - FK (linked to tblcustomer)
- Addresstype (eg: Billing, shipping, office, factory, godown, residence etc.)

tblcustomeraddress
- CustomerAddressID - Autonumber - PK
- CustomerID (linked to tblcustomer)
- Street
- City
- Pin
- State
- Country
- Phone
- Fax

Is this correct. And please let me know how to get this tables to input the details.

I want to make customer address input form just as it is in Outlook contacts.

Dennisk
05-07-2008, 12:32 AM
I would have thought the address type was an attribute of the address and not a seperate table.

i.e.
tbladdresstype
- AddressTypeID - Autonumber - PK
- Addresstype (eg: Billing, shipping, office, factory, godown, residence etc.)


tblcustomeraddress
- CustomerAddressID - Autonumber - PK
- CustomerID (linked to tblcustomer)
- AddressTypeID (linked to tblAddressType)
- Street
- City
- Pin
- State
- Country
- Phone
- Fax

georgedwilkinson
05-07-2008, 06:58 AM
And AddressType should not have an FK from Customer.

By the way, what is a "godown" address type? That is terminology I am not familiar with.

gots
05-08-2008, 03:23 AM
The "Godown" Address type is a "Warehouse" and is referred to as godown in INDIA.

georgedwilkinson
05-08-2008, 09:38 AM
Cool. Do you need more help or do you have it under control now?