Jan's Illustrated Computer Literacy 101 Logo:Jegsworks Jan's Illustrated Computer Literacy 101


Home > Jan's CompLit 101 > Working with Databases > Basics > Access Objects
Icon: Arrow - Previous pagePrevious    NextIcon: Arrow - Next page

Jan's Working with Databases

   Basics: Access Objects

An Access database is made up of objects, which are all saved in one file. In this project you will create a simple database that contains just a few objects: a table, a query, a form, and a report. 

Any database must have at least one table. The power of relational databases like Microsoft Access comes with using several tables and queries to produce forms and reports that enable you to organize your data.

You will start by creating a simple database and get more complex later!


Naming Things in Access

The same rules for names apply to an object like a table, query, form, or report, to a control in the Design view of a form or report, or to a field in a table.

Special Characters
Space  
Apostrophe '
Quotation mark "
At sign @
Grave accent `
Number sign #
Percent %
Greater than sign >
Less than sign <
Exclamation mark !
Period .
Brackets [ ]
Asterisk *
Dollar sign $
Semicolon ;
Colon :
Question mark ?
Caret ^
Braces { }
Plus sign +
Hyphen -
Equal sign =
Tilde ~
Backslash \

A name can have up to 64 characters. It can contain letters, numbers, and symbols except for a period (.), an exclamation point (!), an accent grave (`), brackets ([ ]), and double quote mark ("). You cannot start a name with a space. You can use a space inside a name but it is not always wise.

TipTips about names:

  • Avoid special characters: It often makes for trouble later in queries or VBA modules if there are names that use any of the special characters in the table at the right, including a space. Many of these are allowed but it is best to avoid all of them.
  • Avoid using reserved words:
    Do not use as a name a word that Access uses for its own work. For example the word "Average" is a function that calculates an average of a set of numbers. So you don't want use Average as the name a field also. You just need to get a little creative. AverageScore or AvgScore would work just fine. There is a partial list of the reserved words in the Microsoft Knowledge BaseIcon: Offsite
  • Readable names:
    How do you make it easy to read names without using spaces between words? Capitalizing each 'word' in the name or put an underscore between the 'words'. For example, FirstName or first_name or First_Name would all be good choices. Pick a style and stick with it.
  • When you want to see something else:
    You are not stuck with the field's name in the display of a table datasheet or a form or a report. The Caption property for a field lets you write anything you want as the column heading. The label for a control on a form or report can contain any text that you want.

Programming-Friendly Names

Database programmers like to use names that include a clue as to what kind of thing it is.
This helps them avoid certain kinds of problems in their programs.

Examples:

  • Table:   tblCategories
  • Query:  qryItems-alphabetical
  • Form:   frmStarWarsCollectibles
  • Report: rptStarWarsCollectibles
  • Field:    txtItemName when the field is a Text type
  • Field:    dtAcquired when the field is a Date/Time field
  • Field:    pk_intItemID when the field is the primary key and an integer.
  • Field:    bolGift when the field is a Yes/No field. The "bol" comes from "Boolean" which is the proper term for this kind of field.

These kinds of names may be programming-friendly, but they are not user-friendly!

There is a trend away from this kind of naming, but it is good know what such ugly names mean.

TipProgrammers avoid spaces in names: Spaces can cause problems if you use a Visual Basic program to control how the database behaves.


Undo/Redo Limits

Access can remember up to 20 typing actions or design actions to undo and redo. That is better than just 1, but it is not a lot of actions when you start formatting forms and reports.