Solved

Designing Holiday Request Form

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
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 …
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…

856 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