Learning - Make a phone book? (1 Viewer)

teastrainer

Registered User.
Local time
Today, 04:18
Joined
Sep 30, 2013
Messages
30
OK, I'm just starting so I thought that a phone book might be a good thing to begin with...

I'm not even sure how to go about this though :(

Should I be making every single entry field on it's own table and then pulling them from there into one form or....?

I know it's really basic, but any help much appreciated.

Thanks!
 

teastrainer

Registered User.
Local time
Today, 04:18
Joined
Sep 30, 2013
Messages
30
Googles bringing up lots of thing's that say to use the contacts template, but the point's for me to learn rather than actually really needing a phone book, so I'd like to do it from a blank doc
 

David R

I know a few things...
Local time
Today, 06:18
Joined
Oct 23, 2001
Messages
2,633
Are you wanting a contact book where each person can have one and only one phone number, email, etc? If so a single table should be fine.

If you want to be able to list a Work phone, Home phone, Mobile phone, etc, you want one table that has the 'person' information and another that holds Phone Numbers. You can make the same table hold multiple Emails but you're better off with two subtables.

The way you connect them is through the Relationships screen and your table design. You Main table will have a Primary Key field (usually autonumber type). Your subtables will have their own, separate PK, but also what's called a Foreign Key field. If the PK is Autonumber, the FK should be Long Integer. Draw a line from the Main table PK to the FK in the Phone subtable, and you should get a prompt for making a One-to-Many connection between the two. Repeat as needed for Email table.

The other thing you'll want in your subtable is a field to tell you what Method of contact it is. Comboboxes work well here: "Work", "Home", "Mobile", etc.

Your Form, then, will have the Main information, but also a subform (or two) that shows all Phone Numbers associated with that particular Main PK. Let the subform wizard do the heavy lifting here.

Good luck! Normalization is your friend, google it and curl up with it for an hour or two to wrap your head around how relational databases differ from spreadsheets.
 

teastrainer

Registered User.
Local time
Today, 04:18
Joined
Sep 30, 2013
Messages
30
Hi David -

Well the main reason is for me to learn a bit about Access, but;

I was going to make it with just the entries from my current address book on my phone, entries include;

Name, Phone, Email, Home Number, Nature of relationship (work / friends / family etc), address....

So the Multiple Number's means that a table is required for numbers? I've been looking at this Database and there's only one table there, though there's also a settings field, queries and reports....

A lot of this is trying to get head around the general work flow and how they interact, from table to form to report. And how queries and relations fint in within that!

thanks David.
 

David R

I know a few things...
Local time
Today, 06:18
Joined
Oct 23, 2001
Messages
2,633
A single table with a single Phone and Email will be sufficient to let you tackle the relationships between Form and Table and Report, yes. Try changing the RecordSource of your Form to be a Query as well, for variety. :D
 

mrk

MRK
Local time
Today, 06:18
Joined
Jul 30, 2009
Messages
8
A single table with a single Phone and Email will be sufficient to let you tackle the relationships between Form and Table and Report, yes. Try changing the RecordSource of your Form to be a Query as well, for variety. :D

David R, I have created the PK and FK tables and some queries, my trouble i, when I want to create a query that shows this, I cannot succeed:


[Contact] [Phone 1] [Phone 1 Type] [Phone 2] [Phone 2 Type]
Bob 555-1212 Home 666-1212 Work
Amy 434-1212 Home
Mandy 543-1212 Home 777-1212 Work

This seems like it should be a very common requirement but I am unable to find a sample db or template which accomplishes this. Please help!
 

Users who are viewing this thread

Top Bottom