Hi, Tina.
Glad you liked it! I'll tell the other consultants here, because that makes
three people who've bookmarked our site! (Just kidding. We're up to five
now. ;-) )
Have your ears been burning? Your name came up in a discussion here the
other day. (Don't worry. These were favorable remarks.) Where are you in
L.A.? The Valley?
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
hey, Gunny, just checked out your website. very nice - it joined mvps.org,
lebans.com, granite.ab.ca, and all the other Access bookmarks in my
browser.
the article on marketing was especially interesting, and very entertaining
too! btw, we're neighbors, i'm in so cal also.
in
message Hi, Jonathan.
Any suggestions would be greatly appreciated.
You may want to look even further ahead in your organization's needs for
this database, such as how many other types of phone numbers are likely
to
be added. Pagers come to mind.
I suggest taking these five steps:
1.) Create a table for the types of phone numbers. Add an Autonumber
primary key and the "PhoneType" field to hold the name of the phone
type.
It might look like this:
Table: tblPhoneTypes
PTID PhoneType
1 Business
2 Cell
3 Home
4 Pager
2.) Create a query that gathers the information from the EmpInfo table
in
a
normalized structure and name this query qryEmpPhones:
SELECT EmpNum, HomePhone AS PhoneNum, 3 AS PTID
FROM EmpInfo
UNION
SELECT EmpNum, CellPhone, 2 AS PTID
FROM EmpInfo
UNION SELECT EmpNum, BusinessPhone, 1 AS PTID
FROM EmpInfo;
3.) Create a make table query with the following SQL statement:
SELECT * INTO tblEmpPhones
FROM qryEmpPhones
ORDER BY EmpNum, 3;
4.) Open the tblEmpPhones table and edit the field defaults (such as
size
of the text field), assign the primary key, open the table properties
and
change the Subdatasheet Name combo box to [None], then save the new
table.
5.) Open the Relationships window and create the relationship between
the
tblEmpPhones and tblPhoneTypes tables, then save the change to the
Relationships window.
I'd also suggest not using special keys, like # and spaces in field
names
and table names to avoid bugs later. You may even want to add an
additional
field to the tblEmpPhones table to indicate which phone number is the
primary phone number to reach the employee at.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
message
I didn't normalize my database as well as I wish I had. I have a
table
called EmpInfo that's built essentially as follows:
Emp#
HomePhone
CellPhone
BusinessPhone
What I would likek to do I build a different table called EmpPhones
that
would like like this:
Emp# (this field would be related to the Emp# field in table EmpInfo)
Phone#
Type (the type field would be a lookup to another table with a list of
different types of phone number)
The Emp# and Phone# fields together would make up my multiple field
primary
key.
How would I combine the the HomePhone, Cellphone, and BusinessPhone
into
one
column, and then have 2 other columns with it's associated Emp# and
Type?
Any suggestions would be greatly appreciated.