Office 2007 - Access

Lesson 12: Design View (cont 2…)

12/72 Lessons 

“Field Properties” (2)

3. “Default”

If you ever need to repeat the same value in a field, it is possible to give a “Default” value in it.
For example, most of our albums are on cassette.
When we fill in ‘cassette’ for the “Default” value in the “Field Properties”, then the “Type” field will be automatically filled in with “cassette”.
If the album is on a different media, just type over this text.
les12_image001_en

4. “Validation Rule”

The “Validation Rule” box in the “Field Properties” is used to give one or more rules for determining the data we are to enter in this field.
For example, in the “Value” field we give the value 1, 2 or 3, depending on how we rate the song.
We do not want to enter a different value for this. So, we can set a rule for this.
First, we select the “Value” box.
Select the “Validation Rule” in the “Field Porperties”.
Click the button on the right side of this box.
This opens the “Expression Builder” dialog box.
les12_image002_en
In the upper section of the dialog box, type 1, click the “Or” button, type 2, click the “Or” button and type 3.
When you switch back to “Datasheet view” and you try to give a value other than 1,2 or 3, a warning window appears stating that you can enter only 1, 2, or 3 in this field.

If you like to apply some text with the “Validation rule”, type text directly into this box and place the text in quotation marks. For example, “very good” Or “good” Or “bad”.

An example of how the “Input Mask” and “Validation Rule” of “Field properties” are used together:
For example, for the “Location” field.
Type in the “Input Mask” example “Cabinet” 0, 0, _
And in the “Validation Rule” we type “Cabinet 1” Or “Cabinet 2” Or “Cabinet 3”.
les12_image004_en
Save the table by clicking the “Save” button in the “Quick Access” toolbar.
Switch to the “Datasheet View”.
All you now need to enter in the “Location” is, the number 1, 2, or 3. The word cabinet, plus the space will be added automatically.

5. “Validation Text”

The “Validation Text” in “Field Properties” is the text that appears in the alert window when a value is entered in that field does not comply with the “Validation Rule.”
les12_image003_en

Awesome!
You've completed Lesson 12
START NEXT LESSON