February 5, 2009
Create an Access form that calculates how many months a project has been underway
- Date: September 30th, 2008
- Author: Mary Ann Richardson
Set up a simple form that can quickly tell you how long you’ve been working on a project. Mary Ann Richardson walks through the process.
Do you need to know how long you’ve spent on a project? You can create an Access form that will answer that question for you. Follow these steps:
- Click on the Form Object in the Database Window and click New. (In Access 2007, click the Create tab and then click Forms Design in the Forms group.)
- Click the Text Box control tool and then click and drag in the form where you want to locate the control.
- Click on the text box label and change the caption to Enter Project Start Date.
- Right-click the text box and select Properties.
- Click in the Name Property box and enter ProjectStart.
- Click the drop-down arrow of the Format property box and select cialis c20 ShortDate 6.
- Click the Text Box control tool and then click and drag in the form to create a second text box below the first one.
- Click the text box label and change the caption to Actual Work in Months, as shown in Figure A.
Figure A
-
Right-click the second text box and select Properties.
-
Click in the ControlSource property box and under the Data tab, click the Build button.
-
Type the following function code as shown in Figure B:
=DateDiff(”m”,[ProjectStart],Now())
Figure B
-
Click OK.
-
Close and save the form as Total Work Calculations.
When you run the form and enter a date in the ProjectDate text box, Access will automatically display the number of months from the entered date to today, as shown in Figure C.
Leave a comment
You must be logged in to post a comment.