Databases are used to track information, and in a human resources setting, two of the most important pieces of information are employee birthdates and current ages. Age calculation is helpful for managing benefits and insurance premiums and even scheduling surprise birthday parties. It is also a common practice exercise when learning the basic functions and properties in Microsoft Access, Microsoft's entry level and small business database program.
- Skill level:
Other People Are Reading
Create a new form by clicking on the "Objects" tab and selecting "Forms." Select "Design View" in the dialogue box that comes up, and then click "OK." A database table will launch.
Click on the "Text Box" field and create three text boxes for the form, labelled "Name," "Birthdate," and "Age," respectively.
Click on the field for Birthdate and click "Properties" and set "Short Date." Click on Properties again and set the Name to "Birthdate."
Click on the field for Age and click "Properties." Set the Name to "Age."
Click on the field for Age and then click the "Properties" icon. Choose the "ControlSource" property, and enter the following:
=DateDiff("yyyy", [Birthdate], Now())+ Int( Format(now(), "mmdd") < Format( [Birthdate], "mmdd") )
Switch to "Form" view.
Enter a name in the "Name" column, then enter a birthdate in the Birthdate column. The Age column will show the person's elapsed age from the date given in the birthdate field.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for