A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Business Days Validation



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 13th 07, 09:34 PM posted to microsoft.public.outlook.program_forms
Aggie G
external usenet poster
 
Posts: 15
Default Business Days Validation

I need help writing a validation rule. In the form that I am creating, there
is a turn around time (ETA) of at least 10 business days. I would like to
write a validation that tells the user to enter another date if the date they
entered (Date Needed) is less than 10 business days away from the request
date (Request Date). How would I write this? The form is a message form.
  #2  
Old March 25th 07, 09:11 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Business Days Validation

It's not possible to do that with a simple validation formula. You'd need to put code in the Item_Send event handler to get the number of days with DateDiff() combined with some addition or subtraction based on the day of the week to account for weekends.

--
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

"Aggie G" wrote in message ...
I need help writing a validation rule. In the form that I am creating, there
is a turn around time (ETA) of at least 10 business days. I would like to
write a validation that tells the user to enter another date if the date they
entered (Date Needed) is less than 10 business days away from the request
date (Request Date). How would I write this? The form is a message form.

  #3  
Old March 28th 07, 01:52 AM posted to microsoft.public.outlook.program_forms
Aggie G
external usenet poster
 
Posts: 15
Default Business Days Validation

Can you provide with any samples or direction as to how I would do this? I am
not very versed in VBScript.

"Sue Mosher [MVP-Outlook]" wrote:

It's not possible to do that with a simple validation formula. You'd need to put code in the Item_Send event handler to get the number of days with DateDiff() combined with some addition or subtraction based on the day of the week to account for weekends.

--
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

"Aggie G" wrote in message ...
I need help writing a validation rule. In the form that I am creating, there
is a turn around time (ETA) of at least 10 business days. I would like to
write a validation that tells the user to enter another date if the date they
entered (Date Needed) is less than 10 business days away from the request
date (Request Date). How would I write this? The form is a message form.


  #4  
Old March 28th 07, 01:17 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Business Days Validation

That's what we're here for -- to help you learn these things. But there's a prerequisite: Message forms don't run code unless they're published, and forms with custom fields like yours won't work properly unless they are published so that both sender and recipient can access the published form definition. Do you use Exchange as your mail server? If so, can you publish a form to its Organizational Forms library? If not, can you get everyone who is going to send or receive this form to publish it to their Personal Forms library? If not, then an Outlook form probably is not the right solution for you.

Another important question: Will users create items from this form only on business working days? If so, then you can use a formula after all, because you can just use DateDiff() to make sure the dates are 14 days apart -- 10 business days plus the 4 weekend days in between.

In the meantime, you can also read up on the DateDiff() function in VBA Help.
--
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

"Aggie G" wrote in message ...
Can you provide with any samples or direction as to how I would do this? I am
not very versed in VBScript.

"Sue Mosher [MVP-Outlook]" wrote:

It's not possible to do that with a simple validation formula. You'd need to put code in the Item_Send event handler to get the number of days with DateDiff() combined with some addition or subtraction based on the day of the week to account for weekends.



"Aggie G" wrote in message ...
I need help writing a validation rule. In the form that I am creating, there
is a turn around time (ETA) of at least 10 business days. I would like to
write a validation that tells the user to enter another date if the date they
entered (Date Needed) is less than 10 business days away from the request
date (Request Date). How would I write this? The form is a message form.


  #5  
Old March 28th 07, 02:14 PM posted to microsoft.public.outlook.program_forms
Aggie G
external usenet poster
 
Posts: 15
Default Business Days Validation

The later would probably be a better option, since I have not had it
published to the Exchange Server and more than likely won't be able to.

Most of the people who will use this form will be working on it during the
weekdays, so the 14 day rule I can see would work.

Is DateDiff() used as a validation or VBScript? Also if the persons requests
date is on a Monday, would the calculation count from Monday (the 14th day
would be a Sunday), or would the calculation begin as of Tuesday?

"Sue Mosher [MVP-Outlook]" wrote:

That's what we're here for -- to help you learn these things. But there's a prerequisite: Message forms don't run code unless they're published, and forms with custom fields like yours won't work properly unless they are published so that both sender and recipient can access the published form definition. Do you use Exchange as your mail server? If so, can you publish a form to its Organizational Forms library? If not, can you get everyone who is going to send or receive this form to publish it to their Personal Forms library? If not, then an Outlook form probably is not the right solution for you.

Another important question: Will users create items from this form only on business working days? If so, then you can use a formula after all, because you can just use DateDiff() to make sure the dates are 14 days apart -- 10 business days plus the 4 weekend days in between.

In the meantime, you can also read up on the DateDiff() function in VBA Help.
--
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

"Aggie G" wrote in message ...
Can you provide with any samples or direction as to how I would do this? I am
not very versed in VBScript.

"Sue Mosher [MVP-Outlook]" wrote:

It's not possible to do that with a simple validation formula. You'd need to put code in the Item_Send event handler to get the number of days with DateDiff() combined with some addition or subtraction based on the day of the week to account for weekends.



"Aggie G" wrote in message ...
I need help writing a validation rule. In the form that I am creating, there
is a turn around time (ETA) of at least 10 business days. I would like to
write a validation that tells the user to enter another date if the date they
entered (Date Needed) is less than 10 business days away from the request
date (Request Date). How would I write this? The form is a message form.


  #6  
Old March 28th 07, 02:19 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Business Days Validation

Is DateDiff() used as a validation or VBScript?

DateDiff() is a function available for use in both formulas and VBScript.

Also if the persons requests
date is on a Monday, would the calculation count from Monday (the 14th day
would be a Sunday), or would the calculation begin as of Tuesday?


Isn't that something determined by your own business practices? Maybe you should get out pencil and paper, write down the name of each day, and determine which is the earliest interval from that day that fits your requirements.

--
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

"Aggie G" wrote in message ...
The later would probably be a better option, since I have not had it
published to the Exchange Server and more than likely won't be able to.

Most of the people who will use this form will be working on it during the
weekdays, so the 14 day rule I can see would work.

Is DateDiff() used as a validation or VBScript? Also if the persons requests
date is on a Monday, would the calculation count from Monday (the 14th day
would be a Sunday), or would the calculation begin as of Tuesday?

"Sue Mosher [MVP-Outlook]" wrote:

That's what we're here for -- to help you learn these things. But there's a prerequisite: Message forms don't run code unless they're published, and forms with custom fields like yours won't work properly unless they are published so that both sender and recipient can access the published form definition. Do you use Exchange as your mail server? If so, can you publish a form to its Organizational Forms library? If not, can you get everyone who is going to send or receive this form to publish it to their Personal Forms library? If not, then an Outlook form probably is not the right solution for you.

Another important question: Will users create items from this form only on business working days? If so, then you can use a formula after all, because you can just use DateDiff() to make sure the dates are 14 days apart -- 10 business days plus the 4 weekend days in between.

In the meantime, you can also read up on the DateDiff() function in VBA Help.

"Aggie G" wrote in message ...
Can you provide with any samples or direction as to how I would do this? I am
not very versed in VBScript.

"Sue Mosher [MVP-Outlook]" wrote:

It's not possible to do that with a simple validation formula. You'd need to put code in the Item_Send event handler to get the number of days with DateDiff() combined with some addition or subtraction based on the day of the week to account for weekends.



"Aggie G" wrote in message ...
I need help writing a validation rule. In the form that I am creating, there
is a turn around time (ETA) of at least 10 business days. I would like to
write a validation that tells the user to enter another date if the date they
entered (Date Needed) is less than 10 business days away from the request
date (Request Date). How would I write this? The form is a message form.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i show the difference between past days and furture days? Daisy C21 Outlook - Calandaring 1 January 6th 07 02:27 AM
I wish MS would add the days past and days remaining of the year. DVALENTINE Outlook - Calandaring 2 June 14th 06 01:07 AM
Add business days to Outlook Crystal Outlook - Calandaring 0 April 12th 06 10:13 PM
print week so 1st 4 days on pg1 and last 3 days + notes on pg2? Kathy Outlook - Calandaring 0 April 1st 06 11:30 PM
Validation ~KO Outlook - Using Forms 9 February 22nd 06 08:51 PM


All times are GMT +1. The time now is 10:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.