![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |