Microsoft Access 2010 Bible

(Rick Simeone) #1

Part I: Access Building Blocks


48


To enter a field name, position the pointer in the first row of the Table Design window under the
Field Name column. Then type a valid field name, observing these rules:

l (^) Field names can be from 1 to 64 characters.
l Field names can include letters, numbers, and many special characters.
l (^) Field names can’t include a period (.), exclamation point (!), brackets ([ ]), or accent grave (`).
l You can’t use low-order ASCII characters — for example Ctrl+J or Ctrl+L (ASCII values 0
through 31).
l You can’t start with a blank space.
l (^) You can’t use a double quotation mark (“”) in the name of a Microsoft Access project file.
You can enter field names in uppercase, lowercase, or mixed case. If you make a mistake while
typing the field name, position the cursor where you want to make a correction and type the
change. You can change a field name at any time, even if the table contains data.
Note
Access is not case sensitive, so the database itself doesn’t care whether you name a table tblCustomers or
TblCustomers. Choosing uppercase, lowercase, or mixed case characters is entirely your decision and
should be aimed at making your table names descriptive and easy to read.
Caution
After your table is saved, if you change a field name that is also used in queries, forms, or reports, you have to
change it in those objects as well. One of the leading causes of errors in Access applications stems from chang-
ing the names of fundamental database objects such as tables and fields, but neglecting to make all the changes
required throughout the database. Overlooking a field name reference in the control source of a control on the
form or report, or deeply embedded in VBA code somewhere in the application, is far too easy.
Specifying a data type
The next step is to actually create your tables and define your fields for those tables. You must also
decide what type of data each of your fields will hold. In Access, you can choose any of several data
types (these data types are detailed in the “Assigning field data types” section, later in this chapter):
l Text: Alphanumeric characters; up to 255 characters
l (^) Memo: Alphanumeric characters; very long strings up to 65,538 characters
l Number: Numeric values of many types and formats. The different numeric options are
described in the “Number data type” section, later in this chapter.
l Date/Time: Date and time data
l (^) Currency: Monetary data
l AutoNumber: Automatically incremented numeric counter
l (^) Yes/No: Logical values; Yes/No, True/False

Free download pdf