Business Days Validation

A

Aggie G

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

Sue Mosher [MVP-Outlook]

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

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

Aggie G

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

Sue Mosher [MVP-Outlook]

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

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

Aggie G

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

Sue Mosher [MVP-Outlook]

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

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