Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Database Design

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-27-2010, 05:21 PM
CloudFuel CloudFuel is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jun 2010
Posts: 3
CloudFuel is on a distinguished road
Default Simple Database (atleast I *think* it should be)

I am an apartment locator (real estate agent) and contact many people, so I've gone to a paperless form and have been using excel to keep track of all of their information. I'm seeing that this really isn't the best approach since I cannot easily keep track of this information or easily run reports.

I've started building a database and I think I'm missing an important link. Essentially what I want is a table that contains all of my clients information and since I will have clients with the same name I'm using an auto-numbering ClientID field as my primary key. I also have a table that I'm hoping will be able to keep a log of every contact I have with these clients.

Ultimately I just want to be able input a client's information (which will never really change) and then add details of every contact I have with them while still keeping the previous contact details, so I would have a log of all contacts over time.

I figured that I would need 2 tables and have the same primary key (ClientID - autonumbered) in each table so it would link them together.

I am definitely a beginner with Access, literally just picking up a for dummies book and teaching myself, so any advice is MUCH appreciated! Thanks!!!
Reply With Quote
  #2  
Old 06-27-2010, 06:02 PM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,473
pbaldy is on a distinguished road
Default

Your first table looks okay, but the second would have ClientID as a foreign key, not as a primary key (it would typically have its own autonumber field as a primary key). This is what's called a one-to-many relationship; there can only be one instance of a given ClientID in the client table, but many in the "contacts" table. A common way of presenting this type of data is a form with a subform. The form is bound to the clients table, the subform to the contacts table. Master/child links keep them in sync with each other.
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #3  
Old 06-28-2010, 05:39 AM
CloudFuel CloudFuel is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jun 2010
Posts: 3
CloudFuel is on a distinguished road
Default

Thanks for the reply!

That makes sense to a degree, so I would have two tables like below -

----------------------------------------------

Table:Client

Field:InitialContactDate
Field:ClientID <--- Primary Key
Field:LeadSource
Field:FirstName
Field:LastName
Field:Email
Field:Phone
Field:AltPhone
Field:Area
Field:Size
Field:Price
Field:MoveDate
Field:LookDate
Field:OccupantAmount
Field:MovingReason
Field:CurrentHomeLikes
Field:CurrentHomeDislikes
Field:BrokenLease
Field:Eviction
Field:Misdemeanor
Field:Felony
Field:Amenities
Field:Properties
Field:ClientNotes


Table:Contact

Field:ContactID <---Primary Key
Field:ClientID <---Foreign Key
Field:FirstName <---Foreign Key as well?
Field:LastName <---Foreign Key as well?
Field:ContactDate
Field:ContactTime
Field:ContactType
Field:ContactNotes

----------------------------------------------

Now by doing this, would it allow me to easily pick the client I want to add contact notes to? I doubt I'll be able to remember all of their ContactID's, so I'm really looking for something that will allow me to do 3 things. Create and edit Client Data and then also easily add contact notes as it happens. Then I would want to be able to run reports on say the MoveDate or Price or Area or IntialContactDate, etc...

Thanks again!
Reply With Quote
  #4  
Old 06-28-2010, 06:39 AM
jzwp11 jzwp11 is online now Windows 7 Access 2007 (version 12.0)
Expert
 
Join Date: Jun 2010
Location: Dayton, OH
Posts: 359
jzwp11 is on a distinguished road
Default

There is no need to repeat the client's name in the contact table. You only need it once, so your contact table should look like this:

Table:Contact

Field:ContactID <---Primary Key
Field:ClientID <---Foreign Key
Field:ContactDate
Field:ContactTime
Field:ContactType
Field:ContactNotes

Looking at your client table, I think there may be some fields where it might be beneficial to break out the data into other related tables as well.

For example, these 2 fields imply multiple items
Field:CurrentHomeLikes
Field:CurrentHomeDislikes

If a person's preferences include 3 bedrooms, 2 full baths, back yard etc. That would be best to have in a related table with each specific item as a record. You could actually have a field that distinguishes likes from dislikes within that table. I would think also that you might repeat the same item for multiple clients; if so, it would be best to have a table of these items and join them to the client. An example of that table structure would look like this:

tblClientPreferences
-pkClientPreferenceID primary key, autonumber
-fkClientID foreign key to your client table
-txtPreferenceType (i.e. like or dislike)
-fkItemID foreign key to tblItems

tblItems
-pkItemID primary key, autonumber
-txtItemName

Then looking at the following fields, I wonder if these should be records in a related table of client "issues"

Field:BrokenLease
Field:Eviction
Field:Misdemeanor
Field:Felony
Reply With Quote
  #5  
Old 06-28-2010, 08:00 AM
CloudFuel CloudFuel is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jun 2010
Posts: 3
CloudFuel is on a distinguished road
Default

My only issue with that is that I want to be able to enter ALL client data in one form... and then all client contact info in another form. Can I do that with multiple tables?

Would I be able to view a log of all contacts with said client that way?

I'm having a new issue now... I tried doing the primary key / foreign key thing, but it's saying that I can't have multiple autonumbers in the same table (I had ClientID autonumber foreign key & ContactID autonumber primary key within the Contact table). I'm basically trying to make it to where I can have either a drop down to choose the client I want to include contact info on or be able to type the name in and it finds the client, don't want to have a possibility of spelling the name or whatever wrong and then not having the stuff match up... make sense?
Reply With Quote
  #6  
Old 06-28-2010, 08:33 AM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,473
pbaldy is on a distinguished road
Default

In your contacts table, ClientID is a Number/Long Integer, not an autonumber. You can have combos that display both ClientID and the name, allowing the user to select either, but as jzwp11 mentioned, you should only store ClientID in the contacts table.
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #7  
Old 06-28-2010, 08:40 AM
jzwp11 jzwp11 is online now Windows 7 Access 2007 (version 12.0)
Expert
 
Join Date: Jun 2010
Location: Dayton, OH
Posts: 359
jzwp11 is on a distinguished road
Default

In any relational database (not just Access), the table structure is of utmost importance. Forms should be designed around the tables not the other way around. With that said, you can still do this with 1 form. That form will have many subforms to add the related data.


Quote:
I tried doing the primary key / foreign key thing, but it's saying that I can't have multiple autonumbers in the same table
Yes, only 1 autonumber field in a table. The autonumber should be used for the primary key field; the foreign key will need to be a long number datatype (it is the equivalent datatype to the autonumber datatype).

Having the combo box to select a client is not a problem. You need to work out your table structure first, before working on forms.

It might be beneficial for you to read up on normalization which is the main principle (i.e. "the rules") for setting up your tables. This link has some info on normalization.

You might also find the tutorials on this site helpful.
Reply With Quote
Reply

Bookmarks

Tags
client, primary key, real estate

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple expression! Lon Access 1 05-13-2010 08:45 AM
Simple database required Steve Database Design 2 03-09-2010 03:34 PM
Looking for quick opinion on simple database Zoran Database Design 6 01-31-2010 02:04 PM
Database design for simple inventory toptech Database Design 12 10-24-2009 05:24 AM
simple query taylorosso Queries 1 10-06-2009 02:26 AM


All times are GMT -8. The time now is 01:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.