Lab Assignment 2: Data Entry and Validation
Objective: The goal of this lab
assignment is to teach students how to enter data, set data validation rules,
and use forms in Microsoft Access.
Step 1: Open the Existing Database
1. Open Microsoft
Access.
2. Open the database
created in Lab Assignment 1 (if you've been following the previous assignments).
If not, you can start a new database or use a sample database.
Step 2: Create a Data Entry Form 3. Click on the
"Forms" tab in the navigation pane on the left.
4. Click "Form
Design" to create a new form.
5. In the Form Design
view, you will see the Field List pane on the right, which contains all the
tables and fields from your database.
6. Drag and drop the
Student Information table onto the form. This will create a simple form with
fields corresponding to the table's columns.
Step 3: Implement Data Validation Rules 7. In Form Design
view, click on a field (e.g., the "Name" field) to select it.
8. In the Property Sheet
pane on the right, go to the "Data" tab.
9. Set properties for
data validation rules:
·
Input Mask: Define an input mask for fields that
should follow a specific format (e.g., phone numbers, zip codes).
·
Validation Rule: Define a validation rule using
expressions. For example, to ensure that a phone number is in the format (555)
555-5555, you can set the Validation Rule to: Like "(###) ###-####".
·
Validation Text: Enter a user-friendly message that
will be displayed if data validation fails (e.g., "Please enter a valid
phone number in the format (555) 555-5555").
Step 4: Test Data Validation 10. Save the form.
11.Close the Form Design
view.
12.Open the form in Form
view.
13.Attempt to input data
that violates the validation rules you set (e.g., enter an invalid phone number
format).
14.You should see the
validation message when you try to save the record with incorrect data.
Step 5: Save and Close the Form 15. After testing
the validation, make any necessary corrections to the validation rules or data
format.
16.Save and close the
form.
By following these
steps, students should be able to create a data entry form in Microsoft Access,
apply data validation rules to the form's fields, and test the validation rules
to ensure they work as intended. This assignment helps students understand the
importance of data validation in maintaining data accuracy and integrity within
a database.