Solved

Designing Holiday Request Form

Posted on 1998-11-25
1
760 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't know how to downgrade, my instructions below should be helpful.
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…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

773 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