Creating field in form
To add a field that will calculate a customers age using their date of birth:
- Open up the form you wish to add the field.
- Under the HOME tab, click on the “View” drop-down option located in the ribbon on the far left and change to “Design View”.
- Insert a “text” box by clicking on the image that looks like this: ab|
- Click and drag the text box on your form.
- Open up the “Properties” tab if it’s not open already.
6. Under the Data tab of the Properties window, paste the following code under the “Control Source” row.
=Diff2Dates(“ym”,[ClientDOB],Now())
7. You will need to change the name in the brackets to match the name of your Date of Birth field.
8. Make a label for your field by clicking on the button (see ribbon image above) that looks like this: Aa
9. Click and drag your label box on the form. Complete to your liking.
Your new field will look like this:

Creating Field in Query:
1. Open up your Query. Make sure the Date of Birth field is included in the query.
2. Click on the “View” drop-down and choose “Design View”.
3. Insert a column.
4. In the “field” row under the new column, paste the following.
=Diff2Dates(“ym”,[ClientDOB],Now())
5. It will create the expression. You can change the name of the Expression name. See below for example:
Expr1: Diff2Dates(“ym”,[ClientDOB],Now())
——You can change it to something that you will recognize:
DOBCalc: Diff2Dates(“ym”,[ClientDOB],Now())
By Rana Kory