Entering Field Properties

Entering field properties occurs in the “Design View” window for our table.
When we open a table in “Design View” our window is seen as two halves.
The upper half is what we call the “table design grid” and shows our field names with the data type and any given description for the field.

The lower part is the Field Properties” Window.

In this window, we determine all the properties pertaining to the selected field.

The “Field Properties” window has two tabs: “General” and “Lookup”

It is here we set the properties of the selected field .

For a property attributable to a field, we must first know in which of the two tabs we can find them.
Almost always you will find the property under the “General” tab
The “Lookup” tab, we only use when we have to adjust the properties of the lookup fields.

The “General” tab contains field characteristics that allow us to render exact requiremens for all the fields. (Eg a default value, the size of the field setting, etc.)

If you put the cursor in a textbox property, Access gives you information on this feature.

If you have any questions regarding a particular property, place the cursor in the property textbox, and click F1.

Windows will open a new window containing all the information on the property.

The “Field Size” field property

We can use the “Field Size” property so that we restrict the number of characters to a specific maximum. In the picture above, the “Field Size” is set to 50, which is the default value, which you can always adjust to the desired number, 255 characters being the maximum for a “Text” field.

The properties for a field of type “Number” can be chosen from the following properties:

“Byte”, “Integer”, “Long Integer”, “Single”, “Double”, “Decimal”, and “Replication ID”.
The different properties are illustrated in the following table:

 

The representation of the field property for “Date” / “Time” fields

We have the choice of the following views for the “Date” / “Time” fields:

The representation of the field property for “Logical” fields

We have the following choices for the representation of “Logical” fields:

Enter default values for fields

You can enter a “Default Value” for a field. You can get this value from another “Table” or “Query” or just a value you type.
Suppose you have 100 addresses entered in the database which almost all come from the city of Antwerp.
Then text Antwerp is the “Default Value”

Now, when you switch to “Datasheet View” to the fill in addresses in the field, town is already filled. You can always change the value by double-clicking it and typing in the correct town.

Entering an Input Mask (Input Masks)

An “Input Mask” determines how the data entered should look like. You can use input masks for “Text” and “Date” / “Time” fields.

To set an “Input Mask” we first select the field, place the cursor in the “Input Mask” text box and click the button on the far right of the text field.

Once we have pressed the button, the ” Input Mask Wizard” is started.
Follow the steps of the “Input Mask Wizard” and click “Finish” once you are satisfied.

The creation of validation rules and reactions

We use ‘ validation rule” to apply specific rules on the value for a particular field eg: Suppose you want to enter a birth date in a particular field. This date, of course cannot be in the future. So we use a validation rule in the following way:

The date that you want to enter MUST be today or earlier.

In the validation text box, we show an error message to the user that the date entered is not correct.

The requirements of a data input (“Required” field)

You can make data for a field mandatory by the setting “Required” field property of the text field to Yes.

 

Awesome!
You've completed Lesson 4
START NEXT LESSON