Microsoft Access Training

Understanding Access Database Field Properties

Learn to modify table design and use field properties to improve consistency, guide data entry, and protect database integrity.

Start here

Overview

This lesson enhances the Clients, Travel Agents, and Trips tables by adding a field and configuring field size, format, input masks, validation rules, validation text, and default values.

What You Will Learn

  • Insert a new field in Table Design View.
  • Choose an appropriate Yes/No data type.
  • Reduce Short Text field sizes to practical limits.
  • Apply date and text formats.
  • Create input masks for dates, ZIP codes, and phone numbers.
  • Create validation rules and validation text.
  • Set useful default values.
  • Explain how field properties improve data integrity.

Before You Begin

  • Creating Access databases and tables
  • Primary and foreign keys
  • Basic Access table Design View

Why This Matters

Field properties prevent many errors before they enter the database. They also make forms and tables easier to use by providing consistent formats, valid choices, and sensible defaults.

Plan Your Study

  • Download and open the No Fault Travel practice database.
  • Insert the ActiveCustomer field in the Clients table.
  • Adjust field sizes and formats.
  • Create input masks for date, ZIP, and phone fields.
  • Add a validation rule and validation text for State.
  • Set default values for State and ActiveCustomer.
  • Apply related properties to the Travel Agents and Trips tables.

Next step

Read the complete chapter.

The Learn tab contains the written lesson from Surviving Statistics.

Go to Learn

Written lesson

Learn Understanding Access Database Field Properties

Learn to modify table design and use field properties to improve consistency, guide data entry, and protect database integrity.

Advertisement

Setting Field Properties

Much of the power in an Access database comes when you intitally set it up. One of the essential elements of proper database design is understanding how to use Access' field properties. This lesson will step you through modifying the design of a database and setting field properties to help maintain data intregity.

⬇
No Fault Travel Database to complete this chapter Open or download

Changing Table Design

Generally, you want to avoid changes in table design after you have created other Access objects such as queries, forms, and reports, which are developed from table contents. Since we have not created any other Access objects yet or entered data into our No Fault Travel agency database, a table design change at this point will not have any inconvenient or time consuming consequences.

When changing the design of tables, you can add, delete, or rename fields. Another very important aspect of table design addressed in this lesson is setting field properties. Field properties allow you to add restrictions to the values that can be entered into fields, and thereby help you maintain data integrity in the database.

In this exercise you will add a field and set field properties.

1. Open the No Fault Travel database - either the one you created in the previous lesson or from the link above.

When you open an Access database downloaded from this website, you will need to click "Enable Content" to use it.

You will now enter the Design View of the Clients table, where you can make changes to the table’s design.

Microsoft Access lesson screenshot FieldProperties1

2. In the list of tables, right-click Clients and then select Design View.

Inserting a field

To add a new field, move to a blank row after the last field name and type the name for the new field. If you wish to insert a row above an existing field, move to this field and right click the gray button (i.e., the field selector) just to the left of the field name. Then, from the shortcut menu, choose Insert Row.

1. Right-click on the field selector for the DOB field (the box to the left of the field name).

The shortcut menu for the field should open.

2. On the shortcut menu, select Insert Rows.

A new field should appear above the DOB field.

Microsoft Access lesson screenshot FieldProperties2

3. Click in the Field Name cell for this new field and type ActiveCustomer.

4. Choose Yes/No as the Data Type.

5. In the Description column type, Choose ‘Yes’ if this is an active customer.

Microsoft Access lesson screenshot FieldProperties3

Using a field with this data type allows you to easily specify if a customer is active or inactive. Including this field is useful because it allows you to view only active clients, or create reports which list only active or inactive clients.

6. Save the table after making these changes, but stay in Design View.

Setting Field Properties

You will now set some field properties in this table to have some control on the values entered in those fields. Notice the Field Properties section in the lower portion of the Design View window. Here you can view or make changes to a field’s properties.

1. Move up to and click in the FirstName field.

Look at the Field Properties for the FirstName field. Notice the Field Size is 255.

Microsoft Access lesson screenshot FieldProperties4

The Field Size Property

By default, Access sets all short text fields to 255 characters, the maximum size of short text. You will want to reduce the field size when fewer characters are needed.

For example, if you need only 6 characters in a field, keeping a field size of 255 characters increases the chances of a data entry error. When determining the field size setting, it is better to start too small and increase the field size, rather than to start too large and shrink the field. If you reduce the field size after entering data, you run the risk of truncating (cutting off) some data by making the field smaller than the size of previously entered data.

2. Select Field Size in the Field Properties of the FirstName field. Change the Field Size to 12 characters.

Microsoft Access lesson screenshot FieldProperties5

3. Change the Field Size of the following fields as indicated:

LastName 20 Address1 30 Address2 30 City 15 State 2 Zip 10 Phone 14

You only want to change the field size of the fields with the data type short text in this table. Leave the fields with other data types as they are for right now.

Format Property

Some field data types, such as Date/Time and Number, allow you to specify how you would like the data to appear in those fields. You can choose from several different formats for date fields. For example, you can have Access display the month name or display the date only using numbers. When you click Format under General Field Property, Access will display a drop-down arrow, which when clicked provides list of choices.

The format property for text fields does not offer a drop-down list of formatting options. However, text fields will be displayed in all uppercase or lowercase format if you enter a greater than (>) or a less than (<) symbol, respectively, as the field property for Format.

1. Move to the DOB field. Then move to Format under the Field Properties for the DOB field and click the drop-down list arrow.

2. From the list of Date/Time formats, choose Short Date.

Microsoft Access lesson screenshot FieldProperties6

Using Input Masks

Input masks can make data input quicker and easier by having Access automatically provide formatting features such as slashes (/) in dates and other formatting options. Input masks also help control the kind of data than can be entered into fields.

When working with dates, century compliance is a concern. If the date field will contain dates before 1930, it will be necessary for the user to input the complete four digit year, such as 1922. Otherwise, Access will assume the century is 2000 rather than 1900.

TWith our No Fault Travel agency database, the DOB field of the Clients table could contain dates prior to 1930. By entering the correct input mask you can require that every date entered here have all four digits for the year.

1. Click in the Input Mask row for the DOB field. Click the build button with three dots on the right .

Microsoft Access lesson screenshot FieldProperties7

2. In the Input Mask Wizard dialog box, choose Short Date, and click Next.

Microsoft Access lesson screenshot FieldProperties8

3. In the next step of the Input Mask Wizard dialog box, click Next.

You are selecting the default input mask. In a numeric input mask, 9s mean optional and 0s mean required. So, you are selecting an input mask that will allow you to enter a one or two digit month or day, but require a four digit year.

Microsoft Access lesson screenshot FieldProperties9

4. In the next step of the Input Mask Wizard dialog box, click Finish.

Microsoft Access lesson screenshot FieldProperties10

You should see the input mask entered for the DOB field.

5. Save the Clients table but stay in Design View.

Using the Input Mask Wizard

As you just saw, Access provides a wizard to assist in creating input masks. In this portion of this lesson, you will use the Input Mask Wizard again to create input masks for the phone number and zip code fields.

1. Move into the Zip field.

2. Click in the Input Mask row under the General Field Properties of the Zip field.

If Access asks you to save the table, answer Yes.

3. In the Input Mask row, click the build button, (seen below), on the right.

Microsoft Access lesson screenshot FieldProperties12
Microsoft Access lesson screenshot FieldProperties11

If Access asks you to save the table, answer Yes.

The Input Mask Wizard should open to lead you through the creation of this input mask.

Microsoft Access lesson screenshot FieldProperties13

4. In the Input Mask dialog box, select Zip Code and click Next.

Microsoft Access lesson screenshot FieldProperties14

5. In the next step in the Input Mask Wizard, a nine-digit zip code format is the default provided (with a hyphen to separate the four extension digits). Click Next again.

The input mask uses both zeroes and nines. The zeros are required input for the five- digit zip code. The nines indicate that the four extension digits are optional. If you want to require all nine digits, change the nines to zeroes in the input mask.

Microsoft Access lesson screenshot FieldProperties15

6. Select the option to store the data with symbols in the mask, and click Next.

Here you have told Access to store the hyphen (-) in the zip code so that it displays correctly in reports and labels.

7. Click Finish on the final Input Mask Wizard dialog box.

The input mask you just created should appear in the Input Mask row under General Field Properties of the Zip field in the Clients table.

Microsoft Access lesson screenshot FieldProperties16

8. Save the table to keep this change.

9. Move into the Phone field and click in the Input Mask row under General Field Properties.

10. Use the Input Mask wizard to build an input mask for the Phone field. Accept the default options for the data look and the input mask, (999) 000-000.

Be sure to store the data with the symbols in the mask (e.g., (976) 472-3491).

Microsoft Access lesson screenshot FieldProperties17

The Field Properties for the Phone field should now appear as above with the input mask created by the wizard in the Input Mask row.

Validation Rules

Validation rules let you restrict the information or values that can be entered into a field. Applying validation rules helps ensure data integrity and can make data entry easier. In the next steps, you will apply a data validation rule to the State field.

1. Move into the State Field and add -Only CA, ID, OR, and WA are allowed to the existing field description.

Microsoft Access lesson screenshot FieldProperties18

This description will be visible to the person entering data in the table. However, the description only makes a suggestion to the user to enter those four states into the State field; it does not prevent other states from being entered.

You will create a validation rule that will only allow the four states to be entered into the State field.

2. Move into the State field. Now, click in the Validation Rule row in the Field Properties section.

3. Type CA or ID or OR or WA and press (Enter).

Microsoft Access lesson screenshot FieldProperties19

You can see that Access added quotation marks, around the abbreviation for each state. Access will not allow any values other than what you typed into this field.

Validation Text

After entering a validation rule, Access will not allow any data that does not match the value(s) specified by you. If a user attempts to input incorrect data, Access will display a default error message stating that the data does not meet the validation rule. You can also replace the default message by a user-friendly one in the Validation Text property.

4. Move to the Validation Text property of the State field and type The client must live in CA, ID, OR, or WA. No other states are allowed.

Access will now display this message when incorrect data is entered into the State field.

Default Values

If the user will repeatedly enter the same value in a record field, you can have Access automatically enter that as the default value in new records. Of course, the default value can be changed by the user. In the next steps, you will add default values for the State and ActiveCustomer fields.

1. Move to the Default Value row of the State field. Type ID and then press (Enter).

Access adds the quotation marks for you.

Microsoft Access lesson screenshot FieldProperties20

2. Move to the Format row and insert the greater than symbol (>).

Access will display the state abbreviations in upper case letters, even if the user entered any part of the state abbreviation in lower case.

3. Now move to the ActiveCustomer field so that its field properties are accessible. Type Yes in the Default Value row.

Microsoft Access lesson screenshot FieldProperties21

Since most new customers will be “Active”, you changed the default value of this field to Yes instead of No.

4. Save and close the Clients table.

5. Enter the Design View of the Travel Agents table.

You probably did this by double clicking on the table in the “All Access Objects” pane, and then selecting Design View from the View Group on the Home tab. However, remember you can also simply right click the table in the pane, and then select Design View from the shortcut menu options.

6. Change the Field Size properties of the FirstName field to 12 and the LastName field to 20.

7. Save and close the Travel Agents table.

8. Enter the Design View of the Trips table.

9. Move to the DepartureDate field.

10. Change the Format property to Short Date.

11. In the Input Mask row, type 99/99/9999 and press (Enter).

This time you used 9999 in the year instead of 0000 because a trip departure date will not be before 1930. A user may enter the year into this field as either 4 or 2 digits (i.e., 2017 or 17).

Microsoft Access lesson screenshot FieldProperties22

12. Move to the ReturnDate field.

13. Add the same properties to this field that you added to the DepartureDate field.

14. Save and close the Trips table.

15. Close the No Fault Travel database.

Advertisement

Next step

See the concepts demonstrated.

Continue to Watch for chapter videos and worked examples.

Go to Watch

See it explained

Watch

Choose the explanation or example that best supports your learning.

Instructional videos will be added later.

Next step

Apply what you have learned.

Use the guided questions and activities in Practice.

Go to Practice

Apply what you learned

Practice Understanding Access Database Field Properties

Use the No Fault Travel database to add and test field properties that guide users and prevent invalid entries.

Guided Practice

  • Insert ActiveCustomer above DOB and assign the Yes/No data type.
  • Reduce the FirstName, LastName, Address, City, State, and ZIP field sizes as directed.
  • Apply Short Date formatting to DOB.
  • Create input masks for DOB, ZIP, and Phone.
  • Restrict State to CA, ID, OR, or WA and add validation text.
  • Set ID as the default State and Yes as the default ActiveCustomer value.
  • Apply date properties to DepartureDate and ReturnDate.

Challenge Yourself

  • Test each validation rule with both acceptable and unacceptable data.
  • Create a second validation rule for another field and explain its purpose.
  • Compare an input mask with a format and explain how they differ.
  • Write a short data-entry guide based on the field properties you created.

Check Your Understanding

  • Can you explain why a field size should not be much larger than necessary?
  • Can you distinguish Format from Input Mask?
  • Can you explain the purpose of Validation Text?
  • Can you identify when a default value is useful and when it may be misleading?

Next step

Save the materials you may need later.

Open Resources for the study sheet, spreadsheets, and related learning materials.

Go to Resources

Keep learning

Resources

Study sheets, downloadable files, companion tools, and related lessons for this chapter.

For educators

Teaching this chapter?

The Instructor tab contains objectives, teaching ideas, assessments, and a printable guide.

Open Instructor Resources

LutherMaddy.com — Helping Humans Learn

Understanding Access Database Field Properties: Instructor Resources

Teach this lesson

Instructor Resources

Classroom-ready objectives, teaching ideas, questions, and assessment materials for this chapter.

Learning Objectives

  • Insert and define a new table field.
  • Configure field size and format properties.
  • Create input masks for dates, ZIP codes, and telephone numbers.
  • Create validation rules and clear validation text.
  • Set useful default values.
  • Explain how properties support data integrity.

Prerequisite Knowledge

  • Creating Access tables
  • Field data types
  • Table Design View

Teaching Outline

  • Review the purpose of field properties.
  • Insert the ActiveCustomer field.
  • Adjust text field sizes.
  • Apply formats and input masks.
  • Create validation rules and messages.
  • Set default values.
  • Apply related properties to the remaining tables.

Key Concepts

  • Field Size limits the amount of Short Text data.
  • Format controls how stored data is displayed.
  • Input Mask guides the pattern of data entry.
  • Validation Rule defines acceptable values.
  • Validation Text explains rejected entries.
  • Default Value supplies an initial value for new records.

Classroom Demonstration

  • Enter an invalid State value before and after adding validation.
  • Compare stored data with its displayed format.
  • Test the ZIP and phone input masks.

Questions to Ask

  • Why can an oversized text field increase data-entry errors?
  • How are an input mask and a validation rule different?
  • When can a default value create incorrect data?

Teaching Notes

  • Test every property after saving the table.
  • Clarify that formatting does not necessarily change stored data.
  • Use realistic invalid entries when demonstrating validation.

Assessment Ideas

  • Configure the listed properties in the Clients table.
  • Create one original validation rule.
  • Explain the purpose of every property used.

Grading Rubric

CriterionPoints
New field inserted and defined correctly1
Field sizes and formats correct2
Input masks correct2
Validation rule and text correct2
Default values correct1
Properties tested and explained2
Total10

Exam and Discussion Questions

Basic

  • Define Field Size, Format, Input Mask, Validation Rule, and Default Value.

Applied

  • Create a rule that accepts only four approved state abbreviations.

Conceptual

  • Explain the difference between controlling display and controlling acceptable data.

Keep Exploring

Continue Learning

Explore step-by-step lessons, interactive calculators, downloadable study sheets, and practical educational resources.