Say you have a Due Date field on a form in Access, and you want to show how many days are left until that Due Date arrives. A quick way to do this is to add a new text box to the form, and then use the DateDiff function in that text box to do the calculation.
Right-click the form in the Navigation Pane and then click Layout View.
Click Design > Text Box, hold down the Ctrl key, and then click on the layout where you want to put the text box.
Click the new text box, and press F4 to display the Property Sheet if it's not already displayed.
On the Data tab of the Property Sheet, in the Control Source property box, type the following:
Your form should look something like this:
The expression in this example subtracts today’s date (Date()) from the Due Date. The "d" tells Access to calculate the number of days (as opposed to years, months, etc.). If your text box is named something other than DueDate, substitute your actual text box name in the function arguments.
For more about forms, see Create a form in Access.