Hi,
I am creating some table for a database I want to use.
I had the following tables:
[Organisation]
orgOrganisationID (primary key)
orgName
orgPostalcode
orgStreet
orgCity
orgCountry
[Contacts]
coContactID (primary key)
coSurename
coFirstname
coFysicPostalcode
coFysicStreet
coFysicAdditions
coPostPostalcode
coPostStreet
coPostAdditions
coTel
coFax
coEmail
[Postalcodes]
poPostalcode (primary key)
poPostalCity
poPostalCountry
I have two postalcodes in the Contacts table. I can't create two one-on-many relations from the Postalcodecodes table to the Contacts table.
So I thougt I split up the contacts table and create a one-on-one relationship between the two new tables.
So it would look like this:
ContactsGeneral
cgGeneralContactID (primary key, autonumbering)
cgSurename
cgFirstname
cgFysicPostalcode
cgFysicStreet
cgFysicAdditions
cgTel
cgFax
cgEmail
ContactsPost
cpPostContactsID (primary key, numeric)
cpPostPostalcode
cpPostStreet
cpPostAdditions
I would create a one-on-one relationship between coGeneralContactID and coPostContactsID. And now I can create my one-on-many relationships between from the Postalcodes table.
1) Is this clever?
2) Should both these fields have a key?
3) I set coGeneralContactID to autonumbering and coPostContactsID to numeric. is this also correct.
4) I also use prefixes before the fieldnames 'cp-' for 'ContactsPost' is this naming convention ok? I think it makes programming easier. But are there condingstandards for that in Access/VBA?
Thanks,
Jayke
I am creating some table for a database I want to use.
I had the following tables:
[Organisation]
orgOrganisationID (primary key)
orgName
orgPostalcode
orgStreet
orgCity
orgCountry
[Contacts]
coContactID (primary key)
coSurename
coFirstname
coFysicPostalcode
coFysicStreet
coFysicAdditions
coPostPostalcode
coPostStreet
coPostAdditions
coTel
coFax
coEmail
[Postalcodes]
poPostalcode (primary key)
poPostalCity
poPostalCountry
I have two postalcodes in the Contacts table. I can't create two one-on-many relations from the Postalcodecodes table to the Contacts table.
So I thougt I split up the contacts table and create a one-on-one relationship between the two new tables.
So it would look like this:
ContactsGeneral
cgGeneralContactID (primary key, autonumbering)
cgSurename
cgFirstname
cgFysicPostalcode
cgFysicStreet
cgFysicAdditions
cgTel
cgFax
cgEmail
ContactsPost
cpPostContactsID (primary key, numeric)
cpPostPostalcode
cpPostStreet
cpPostAdditions
I would create a one-on-one relationship between coGeneralContactID and coPostContactsID. And now I can create my one-on-many relationships between from the Postalcodes table.
1) Is this clever?
2) Should both these fields have a key?
3) I set coGeneralContactID to autonumbering and coPostContactsID to numeric. is this also correct.
4) I also use prefixes before the fieldnames 'cp-' for 'ContactsPost' is this naming convention ok? I think it makes programming easier. But are there condingstandards for that in Access/VBA?
Thanks,
Jayke