I don't think I understand. Do you suggest I use
lutblContactNumberTypes
NumberType (Text, PK)
DisplayOrder (Long, allows the dropdown lists to be
sorted into something other than alphabetic
order)
PriorityWorkingHours
PriorityCommuteHours
PriorityNight
PriorityWeekend
PriorityVacation
Instead of
lutblContactNumbersType
Home Number
Cell Number
Work Number
Fax Number
Pager Number
I also don't understand where DisplayOrder (Long, allows the dropdown lists to be
sorted into something other than alphabetic
order) is
Thanks,
Linda
Hi Linda,
It's a trade-off. If you have separate fields in the main table for
HomeNumber, CellNumber, NextOfKinNumber etc. it keeps things simple for
the time being ... but every time you need to storea another kind of
contact number (e.g. PagerNumber) you have to modify the table (to add a
field) and the queries, forms and reports (to display the new field).
Simple queries are simple, but complex ones (like the example I gave
below) can get very difficult.
On the other hand if you go the whole hog with something like this
lutblContactNumberTypes
NumberType (Text, PK)
DisplayOrder (Long, allows the dropdown lists to be
sorted into something other than alphabetic
order)
PriorityWorkingHours
PriorityCommuteHours
PriorityNight
PriorityWeekend
PriorityVacation
tblContactNumbers
EmployeeID (FK into tblEmployees)
NumberType (FK into lutblContactNumberTypes)
(EmployeeID and NumberType are both in the
primary key)
ContactNumber
adding another type of contact number is simply a matter of adding a
record to the lookup table.
NB: in case you haven't guessed, the "PriorityXxx" fields in the lookup
table (or something similar) are there to make it easy for queries to
return either the first number to try in various circumstances, or a
list of numbers in the order in which they should be tried. That's
useful for a human operator, and essential for an automated call-out
system.
Taking this a step further and a step off topic, since text messages,
email and messaging to mobile devices and VOIP to mobile devices are all
intruding on the role of the traditional pager, it might be worth
considering whether to generalise the concept of "contact number" beyond
just something one dials on a telephone to include email addresses, IM
handles, etc.
I like the idea of "dead simple" and if Nulls are ok then
why not just put all of the Telephone/Contact Numbers in the main table?
But, my intent here is to learn the right way to do things. So, would
this table design below be ok? Also, for the look up tables, do you
guys use lutbl or just tbl to name them and is there a primary key in
this table (why or why not)? Next to the contact type I'll put the
number of employees that have each contact type in case that makes a
difference in how one would go about the design of these tables.