Hi Lisa,
There is a person here who does a lot of work in Access 2003 (I have 2007
and it confused him).
I can certainly identify with this person. Access 2007 confuses me a lot too!
He suggested that all the information go into one table.
No--no--no! Your friend needs to spend some time reading up on database
normalization. Tables include fields (attributes) that should describe a
single subject, much like a written paragraph in English should cover a
single subject. A common mistake of beginners is to import a flattened
structure from Excel. At that point, they essentially have an "Access
spreadsheet". Poor database design can make it a lot more difficult in the
long run.
Do I really need a primary key at all?
All tables should have a primary key or uniquely indexed field. This allows
you to identify a unique records amongst hundreds or thousands or records. A
primary key is uniquely indexed, by definition. A primary key must be unique,
and cannot be null (unknown). However, a uniquely indexed field is not a
primary key until one actully sets it as the primary key. As you will start
to learn the more you explore, Access allows users to create designs that are
not optimum.
I'll address field names first. I wasn't told anything and at this point I
hadn't seen anything in the book (haven't done much looking through it yet)
that said not to use spaces. I did read something about that today.
Access allows one to use spaces and special characters in field names, but
it is really not adviseable. It will cause you extra work in the long run, as
often times you will need to remember to add square brackets around a name
that includes special characters and/or reserved words. At other times, the
use of such names can produce errors that are difficult for beginners to
track down. As an example, a hyphen (-) in a field name can later be treated
as subtraction by Access. A pound (#) sign is a special character reserved
for creating hyperlinks in Access. Many of the Microsoft samples available
for download include spaces and special characters in the field names, names
of objects (tables, queries, forms, reports, etc.) and controls on forms and
reports. That doesn't mean that it's a practice that you should adopt. In
fact, it flies in the face of their own advice in this KB (Knowledge Base)
article:
Special characters that you must avoid when you work with Access databases
http://support.microsoft.com/?id=826763
Family is the main table, Deceased Members is another table...
Why? Why not just have a field named something like DateOfDeath in the
Members table? Leave the field null for those members who are still pink and
breathing.
When I change the fields on the main table, will that update the queries or
do I have to re-do them all?
This can be a hit and miss proposition. As long as you have Name Autocorrect
enabled, and the Name Maps are updated, then this feature will generally do a
good job of updating changes in the field names. However, there are many good
reasons to avoid using this feature, which I like to call "Name Autocorrupt".
That name should give you a good clue as to why this "feature" may not be so
desireable.
Access 2003 will automatically update name maps when one enables Name
Autocorrect. Prior versions will not. In Access 2002 and earlier, you would
have to open each object in design view and then save it in order to update
the name maps. If ULS (User Level Security) was applied, you would need to
have the correct permissions to save these design changes. Name Autocorrect
will not update any references to fieldnames, table or query names, etc. in
VBA code. There are tools available to assist users with renaming tasks:
Find & Replace:
http://www.rickworld.com/products.html
Speed Ferret:
http://www.moshannon.com/speedferret.html
Ucora:
http://www3.bc.sympatico.ca/starthere/findandreplace/ (Free)
V-Tools:
http://www.skrol29.com/us/vtools.php (Free)
As far as using the auto-number field as the primary key. The book says to
use that when nothing else makes sense or works.
The decision to use an Autonumber key versus a candidate key is one that
each developer needs to make for themselves. There have been great debates in
the various newsgroups, with staunch advocates on both sides of the fence.
These debates sometimes degenerate into arguments as ferocious as religous
wars. With that said, I prefer the ease of use of Autonumbers myself.
Member Numbers
I think you've already established that Member number is not a suitable
primary key, so I won't comment further on that.
They would have 2 different member #'s in that case and of
course be listed twice in the table.
They may have two different member numbers, but that doesn't mean that the
person's name should be listed twice in the database. Instead, it suggests
that you should have a related child table for memberships, where you can
establish a one-to-many (1:M) relationship betweens Members and Memberships.
When you start repeating data, you multiply your chances of making mistakes.
Also, think about a mailing list report later on. If you duplicate members
names, are you going to want to send out duplicate mailings?
The only reason why I put these all into one talbe in the first place
(originally it was one table for Auxiliary, one for Legion, one for SAL and
one for courtesy copies) was because our "helper" said they should be all
together.
Again, your helper needs to spend some time studying database design
(normalization).
I have a Word document I call Access Links.doc, that I think you will find
quite helpful. You can download a zipped copy from here:
http://www.accessmvp.com/TWickerath/
For the present time, concentrate on just the first couple of pages. This
includes information on special characters to avoid, reserved words, database
design, best practices (make sure that you have the latest updates), Name
Autocorrect, Relationships, along with a lot of useful links to other web
sites. Also, head on over to Access MVP Crystal's new site and download her
Access Basics tutorials:
http://www.accessmvp.com/Strive4Peace/Index.htm
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________