Locked lesson.
About this lesson
Explore the options for designing in the datasheet view.
Exercise files
Download this lesson’s related exercise files.
5.01 working-in-datasheet-view - Exercise.docx43.9 KB 5.01 working-in-datasheet-view - Exercise solution.docx
150.7 KB TechGurusTicketing07.accdb
600 KB TechGurusTicketing07 - Complete.accdb
596 KB
Quick reference
Working in Datasheet View
Explore the commands on the contextual ribbons when working in datasheet view.
When to use
It's important to understand the commands available on the contextual ribbons and the limitations of using Datasheet view so we can make an informed decision regarding which view to use for certain tasks.
Instructions
To switch to Datasheet View
- From the Home tab, click Views and select Datasheet View.
- OR, from the Table Tools tab, click Views and select Datasheet View.
- OR, click the Datasheet View button in the Status Bar.
Using Datasheet View to Design
Datasheet view is used predominately to add records to the table. However, it can be used to control some design elements also. It's not as flexible as Design view and the changes we can make are minimal. Let's explore the options we do have if working in Datasheet view is our preference.
The Table Fields Contextual Ribbon
Notice in Datasheet view, we have two contextual ribbons: Table Fields and Table.
- Click on the Table Fields tab.
Switching Views
- Click View to toggle between Datasheet View and Design View.
Adding and Deleting Columns
We've already seen how to add new columns to the table by clicking the Click to Add column at the end. This will always add a new column to the end of the table.
If we want to add a new column in the middle of the table, we can do this by selecting a data type from the Add & Delete group.
- Click on the column to the left of where you want the new column to be added.
- Select a data type from the Add & Delete group to add a new column.
- To delete a column, select the column and click Delete.
Modifying Field Properties
We can modify the field properties in the Properties group. The properties we can change here are minimal compared to Design view.
- Select the CustomerName column.
Notice the active buttons. We could change the Field Size, set a Default Value, or add a name and caption. The other buttons in this group are greyed out/not available.
- Select the Priority column.
This column contains the drop-down list that we created using the Lookup Wizard. Notice that an additional button, Modify Lookups is now available. We can use this to make changes to the value list.
- Select the Description column.
Notice the Memo Settings button is now available.
We have two options: Append Only or Rich Text.
Append Only means that users will only be able to add new information to the description and not edit existing information. Rich Text means that users can change the existing description and use formatting such as bold and italics.
- Select the Charge column.
We can make changes to this field using the commands in the Formatting group. We can change the currency, change the format and increase and decrease the decimal places. We can also see at a glance the validation options set for this field. This field is required and indexed.
- Click Validation and select Field Validation Rule.
This will show the current validation rule set for this field.
- Click Validation and select Field Validation Message.
This will show the current validation message set for this field.
Using the Expression Builder
It might be that you need validation to consider more than one field at a time. For example, in the Charge field, the current validation rule states that the minimum charge has to be greater than 50. However, what if we also want to set a rule that says the charge cannot be greater than 2000?
We can use the Expression Builder to set this up.
- Click Validation and select Validation Rule.
The Expression Categories list shows the fields in the current table. We can use these fields to build an expression and create a rule.
- Double-click on the Charge field.
- Type '<=2000' (less than or equal to).
The expression should look like this:
[Charge]<=2000
- Click OK.
Now, let's add a validation message.
- Click Validation and select Validation Message.
- Type 'Charge must not exceed $2000'.
- Click OK.
Test the validation is working.
- Change the Charge for the first record to '3000' and click elsewhere in the table.
If the validation is working, we should see the validation message.
The Table Contextual Ribbon
The Table ribbon mainly contains commands that are outside the scope of this course such as creating macros and adding events. However, we can also access table properties from here and see any relationships we've created between tables.
We are going to look at both of these in more detail later on in the course.
Hints & tips
- In the Add & Delete group, click More Fields to see the full list of data types.
Lesson notes are only available for subscribers.