Page 44 - AIS access_chang_ingraham
P. 44

42    CHAPTER 3  USING ACCESS TO IMPLEMENT A RELATIONAL DATABASE



                         Table 3-1 Field Properties in Access

                          Field Property         Description

                          Field Size             Sets the maximum size for data stored in a Text, Number, or
                                                 AutoNumber field. In a Text field, the default size is 50, but the size
                                                 may range from 1 to 255. In Number fields, the default is set to
                                                 Long Integer.
                          Format                 Specifies how data are to be displayed in a field. Particularly useful
                                                 in specifying the format for numbers, currency, dates, and times.
                          Decimal Places         Specifies the number of digits allowed to the right of the decimal
                                                 point. Auto allows the Format property to determine the number of
                                                 decimal places automatically.
                          Input Mask             Makes data entry easier by adjusting the data entered so that it con-
                                                 forms to the standard set in the Input Mask. Also used to control the
                                                 values users can enter. Review the InputMask property help screen
                                                to familiarize yourself with this property. See Steps 6-8 below.
                          Caption                Specifies the text for labels attached to controls created by dragging
                                                 a field from the field list, and serves as the column heading for the
                                                field when the table or query is in Datasheet view. Captions should
                                                 be descriptive of the Field Names they relate to since they will be
                                                 used as headings for the data in creating Forms and Reports.
                          Default Value          Specifies a default value for a field (e.g., San Jose can be set as the
                                                 Default Value for a City field; the user then has the option of accept-
                                                 ing the Default Value or inputting different data).
                          Validation Rule        Specifies the requirements and limits the values allowed for data
                                                 entry. For example, the Validation Rule may begin with the word
                                                 "Like" and continue on with a series of characters placed in quotes
                                                to set the requirements for data to be entered into the field. The
                                                 mean!ng of these characters is found under the Input Mask Syntax
                                                 and Examples help screen. Review the Validation Rule property help
                                                 screen to familiarize yourself with this property.
                          Validation Text       The text input in the Validation Text property specifies the message
                                                to be displayed to the user when the Validation Rule is violated. For
                                                 example, when a record is added for a new employee, you can
                                                 require that the entry in the Start Date field fall between the compa-
                                                 ny's founding date and the current date. If the date entered isn't in
                                                this range, you can display the message: "Start date is incorrect."
                          Required               Specifies whether or not a value is required in a field; if Yes, the
                                                field requires a value, if No, no entry is required.
                          Allow Zero Length      Indicates whether an empty string (i.e., a string containing no char-
                                                 acters) is a valid entry; if Yes, the field will accept an empty string
                                                 even when the Required property is set to Yes.
                          Indexed               This sets a single-field index (i.e., a feature that speeds the sorting and
                                                 searching of a table by allowing the program to do a speed search on
                                                the field). The primary key is always indexed. When a field is indexed,
                                                 it is also necessary to specify whether duplicates will be allowed. For
                                                 example, when creating a purchase table, the primary key might be
                                                 Purchase# and you would not want to allow duplicates. However,
                                                 when creating a table to add the inventory purchased on a particular
                                                 purchase, you might still want to be able to sort and search based
                                                ·upon the Purchase# (which would require that field to be indexed), but
                                                 you wo'uld expect that a particular purchase might have several items
                                                 of inventory. Therefore, duplicates would be allowed.
   39   40   41   42   43   44   45   46   47   48   49