Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / August 2005

Tip: Looking for answers? Try searching our database.

how to setup for 2 addresses per person

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Boze - 12 Aug 2005 16:31 GMT
I'm very new to Access so this is a very basic question.
As my first project I'm setting up a database on politicians in my state.
Some will have 2 addresses..1 in our state and 1 in Wash DC.  They also will
have 2 websites.. their official site and their re-elect site.  I'm not sure
how to set the tables up for this.  Would I use Address1, City1, Phone1, etc
for the state info and a separate table with Address2, City2, Phone2 for the
DC ?

Thanks for any help.  I'd also be interested in any online tutorials if
anyone cares to recommend some.

Boze
KARL DEWEY - 12 Aug 2005 16:38 GMT
Use the same table and have a flag field for residence R, work W, vacation V,
etc.

> I'm very new to Access so this is a very basic question.
> As my first project I'm setting up a database on politicians in my state.
[quoted text clipped - 8 lines]
>
> Boze
Baz - 14 Aug 2005 10:06 GMT
> I'm very new to Access so this is a very basic question.
> As my first project I'm setting up a database on politicians in my state.
[quoted text clipped - 8 lines]
>
> Boze

I suggest that you simply create two sets of fields on the one table.
Tim Ferguson - 14 Aug 2005 16:29 GMT
> As my first project I'm setting up a database on politicians in my
> state. Some will have 2 addresses..1 in our state and 1 in Wash DC.

I don't believe this: there will also be the agent's address, the home
address, the one to send bulk material to, the billing address, etc etc.

> They also will have 2 websites.. their official site and their
> re-elect site.  

Ditto: what about the opponent's knocking site, the unofficial fan site,
the IMDB page, etc, etc?

>I'm not sure how to set the tables up for this.  

It's simply two straightforward one-to-many relationships e.g.

 People (
   PersonID primary key,
   FirstName,
   LastName,
   NickName,
   CurrentCredibility,
   etc )

 Addresses (
   BelongsTo foreign key references People,
   TypeOfAddress
   Street,
   City,
   etc
   Primary Key (BelongsTo, TypeOfAddress)
   )

 Websites (
   URL primary key,
   BelongsTo foreign key references People,
   LastVisitDate,
   etc
   Primary Key (URL, TypeOfWebsite)
   )

To make the compound primary keys, in the Table Design grid, ctrl+click
both fields and then click the yellow key Primary Key tool.

If the PersonID is an autonumber, then the two BelongsTo keys must be
long integers. Use the relationships window to drag BelongsTo over the
People.PersonID and remember to check ON the box for Enforce Relational
Integrity.

You might want to use another table(s) to control the contents of the
TypeOf fields

> I use Address1, City1, Phone1, etc for the state info and a separate
> table with Address2, City2, Phone2 for the DC ?

No: that way disaster lies. It will be one week after release when
someone wants a third address type, and then you'll be redesigning every
single table, query, form and report. Better just to design it right
first time and then sit back relaxing...

Hope that helps

Tim F
Boze - 15 Aug 2005 18:08 GMT
Yes, that helps alot.  Thanks for the clear explanation.
Boze

>> As my first project I'm setting up a database on politicians in my
>> state. Some will have 2 addresses..1 in our state and 1 in Wash DC.
[quoted text clipped - 59 lines]
>
> Tim F
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.