Note |
Access stores text and memo data in a format called Unicode. This format handles accented characters, foreign alphabets such as Greek or Hebrew, and even mathematical symbols with ease. so, there's no need to worry about what kind of data your text fields can hold.
Field size - This property dictates the maximum number of characters you can store in the field. You can have fewer characters in the field, but Access won't let you enter more than this number. The maximum field size for a text field is 255.
Format - The format property controls the way in which the data in a field is displayed. You'll learn more about this when you discuss in date/time fields in the following section
Input mask - The input mask property supplies a pattern that data entered into the field must match.
Caption - The caption property is used in place of the field name when the field name is displayed. For example, the columns in a datasheet will be labeled by captions instead of field names if you supply a caption. This enables you to use friendlier names where people will see them, while still using names without spaces for the fields themselves.
Default value - The default value property supplies a value to be used for the field in a new record. If you do not overwrite the default value with other data, it is saved with the record.
Validation rule - The validation rule property let you specify a formula that limits the data entered into a field. You'll see an example when we discuss the number data type in the section - "Number Field Properties."
Validation text - The validation text property supplies a message that Access displays if the user tries to break a validation rule
Required - The required property is just what it sounds like: If you set it to Yes, you can not save a record in the table without filling in this field
Tip |
To change the value of a property such as Required from No to Yes, or vice versa, just double-click the property.
Note |
Replication IDs are coded values used in databases that are maintained on multiple computers simultaneously. You'll probably never use a replication ID in your own database.
Tip |
For most data, you'll be safe using long integer fields for numbers without factions and double fields for numbers with fractions
Note To Be -
When choosing a field size for a numeric data type, you need to keep in mind several things:
What's the largest value you might need to store?
Is the value a whole number, or does it have a fractional part?
Are you worried about rounding errors?
Tip |
Whenever you set the Validation Rule property, you should also set the Validation Text property. That's the best way to give feedback to database users when they make a mistake
Examples of Validation Rules
Rule | Meaning |
<=50 | Less than or equal to 50 |
<>5 | Not equal to 5 - any value except 5 is allowed |
Is Not Null | Must enter something, rather than leaving the field blank. This is equivalent to setting the required property to Yes |
<10 or Is Null | Less than 10; otherwise, blank |
Like "B*" | Must start with the letter B. The asterisk is a wild card that matches any number of characters. |
Like "?????X" | Must be six characters and end with the letter X. The question mark is a wild card that matches precisely one character. |
Between #1/1/2001# And #12/31/2005# | Any date between January 1, 2001, and December 31, 2005. The pound signs are how Access Indicates dates in an expression. |
Tip |
Tip |
Tip |
Tip |