Forms and Time

D

Drew

Can anyone help?

I am trying to make a form in outlook that you enter an alloted time, a
start time, and an ending time. the form then calculates how much time has
been used and how much time is remaining fro mthe alotted time.

Thanks in advance for your help.
 
D

Drew

To be more specific:
I know all the fields i need i just need to know the function/code to do the
calulations.

Thanks,
Drew
 
S

Sue Mosher [MVP-Outlook]

Is this something you want to do with a formula or with VBScript code behind the form? Regardless, you'll want to use the DateDiff() function to calculate the difference between two date/time values.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

DateDiff() is a function that you can use in a formula as well as in VBScript:

1) Bring up the Properties dialog for the control that's bound to the field where you want to store the calculated value and go to its Value tab.

2) At the bottom of the dialog, select "Calculate this formula automatically," and click Edit to bring up the formula editor.

3) Under Function, look under Date/Time, and select DateDiff(). That will put this shell into the editor:

DateDiff( interval , date1 , date2 , firstweekday , firstweek )

You can delete the last two parameters.

4) The first parameter, interval, is what unit do you want the result in -- days, weeks, etc. Days would be "d"

5) The other two parameters are your two date fields. You can type them in, surrounded by brackets. Or, you can insert them using the Field choices on the edit window.

6) Click OK to return to the form. Run the form, and enter some data to test.

If you run into problems, post back with the exact text from your own formula.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top