Locked lesson.
About this lesson
Use an expression to perform calculations on fields and display new information, such as an end date.
Exercise files
Download this lesson’s related exercise files.
10.01 calculations-using-expressions - Exercise.docx57 KB 10.01 calculations-using-expressions - Exercise solution.docx
96.1 KB TechGurusTicketing25.accdb
924 KB TechGurusTicketing25 - Complete.accdb
928 KB
Quick reference
Calculations Using Expressions
Use the Expression Builder to create a simple calculation.
When to use
Create an expression whenever you want to perform a calculation on numeric fields in a table.
Instructions
Display in the subform the date that the SLA expires (End Date). The EndDate information is not available in any table, but we can calculate this using the StartDate field and the SLA field.
- Open the form ‘frmRelatedTickets’ subform.
- Switch to Design View.
- From the Form Design tab, in the Controls group, select the Text Box control.
- Draw a text box on the subform.
- From the Form Design tab, in the Tools group, click Property Sheet.
- Click on the control label and adjust the properties as follows:
- Name: EndDateLabel
- Caption: End Date
- Click on the Unbound field.
- Name: EndDate
- In the Control Source field, click the three dots to open the Expression Builder.
- Double-click on the StartDate Field.
- Add the + symbol.
- Double-click on the SLA Field.
- Click OK.
- Switch to Form View to check the calculation is working correctly.
- Close the Form and Save the changes.
- Open ‘frmTicketMaintenance’ and check you can see the ‘EndDate’ field in the subform.
Lesson notes are only available for subscribers.