Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / June 2006

Tip: Looking for answers? Try searching our database.

Forms and Time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Drew - 29 Jun 2006 14:52 GMT
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.
Drew - 29 Jun 2006 15:05 GMT
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
Sue Mosher [MVP-Outlook] - 29 Jun 2006 15:09 GMT
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.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

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

"Drew" <Drew@discussions.microsoft.com> wrote in message news:EBC06923-C25B-40BB-B2CD-02C651A460B3@microsoft.com...

> 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.
Drew - 29 Jun 2006 18:36 GMT
I would like to use a formula as i don't know aything about vbscript.

> 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.
>
[quoted text clipped - 7 lines]
> > 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.
Sue Mosher [MVP-Outlook] - 29 Jun 2006 19:05 GMT
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.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

>I would like to use a formula as i don't know aything about vbscript.
>
[quoted text clipped - 9 lines]
>> > 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.