Solved

Designing Holiday Request Form

Posted on 1998-11-25
1
746 Views
Last Modified: 2012-06-21
I am new to Designing in outlook.   I have created two text box date controls in which the user enters the Start and End date for a holiday request from their manager.  I can calculate the difference between the dates but would like to exclude weekends, public (uk) holidays etc.  How can I do this.
0
Comment
Question by:zqureshi
1 Comment
 
LVL 5

Accepted Solution

by:
chewhoung earned 100 total points
ID: 1622021
For checking weekend day, you have to use the Weekday Function in vbscript.

Returns a Variant (Integer) containing a whole number representing the day of the week.

Syntax

Weekday(date, [firstdayofweek])

The Weekday function syntax has these named arguments:

Part      Description
date      Required. Variant, numeric expression, string expression, or any combination, that can represent a date. If date contains Null, Null is returned.
firstdayofweek      Optional. A constant that specifies the first day of the week. If not specified, vbSunday is assumed.
Settings

The firstdayofweek argument has these settings:

Constant      Value      Description
 
vbUseSystem      0      Use the NLS API setting.
vbSunday      1      Sunday (default)
vbMonday      2      Monday
vbTuesday      3      Tuesday
vbWednesday      4      Wednesday
vbThursday      5      Thursday
vbFriday      6      Friday
vbSaturday      7      Saturday
Return Values

The Weekday function can return any of these values:

Constant      Value      Description
 
vbSunday      1      Sunday
vbMonday      2      Monday
vbTuesday      3      Tuesday
vbWednesday      4      Wednesday
vbThursday      5      Thursday
vbFriday      6      Friday
vbSaturday      7      Saturday

For the public holiday part, you have to create a table in a database to store holidays in UK. Then in your form, you have to use vbscript to open the database, open the table and check whether the From and To date has holidays between them.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now