Jump: Search:

Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access 2007/2010 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2010 (32 bit), 2007, 2003, 2002, 2000, and
Visual Basic 6.0!

Also available for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

 

 
Royalty free source code library modules for Microsoft Access, VB6, VBA, OfficeRoyalty free source code library modules for Microsoft Access, VB6, VBA, OfficeVBA and VB6 Source Code Library Download the free trial version of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA
Category: General VBA/VB6 : Date and Time
Description: Date and time routines, including business day math

Class: CBusinessDatesTable

Business day math (taking holidays into account) with holidays stored in a table

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the CBusinessDatesTable class
AddBusinessDays Method Add or subtract a number of business days to a date. Weekend dates (Saturday and Sunday) are not counted in adding/subtracting days.
AddHolidayRecord Private Add a record to the holiday table
AddToHolidayTable Method Add records to the holiday table as defined in the Initialize function
Class_Terminate Terminate Close opened objects
CreateHolidayTable Method Create a table for the holiday records
DiffBusinessDays Method Returns the number of business days between two dates. Weekend dates (Saturday and Sunday) and holidays are not counted.
DiffWeekdays Private Returns the number of weekdays between two dates. The days are rounded down (it takes 24 hours to make a day)
FindHoliday Private Locates a holiday in the private holiday array
FixHolidayDate Method For fixed date holidays (New Year's, 4th of July, Christmas), returns the celebrated date based on Federal guidelines. i.e. Saturday dates are shifted to Friday, and Sunday dates are shifted to Monday.
GetBusinessDay Method Determine if a date is a business day and if not, find the next or previous business day. Weekend dates (Saturday and Sunday) are not considered business days.
GetHolidayName Method Determine if the specified date is a holiday (in the holiday table), and if so, provide the name Requires the holiday field name to exist and containing a value to retrieve.
GetNextHoliday Method Determine the next holiday date after the provided date
GetNextHolidayName Method Get the next holiday date and name after the provided date
GetPrevHoliday Method Determine the holiday date before the provided date
GetPrevHolidayName Method Get the holiday date and name before the provided date
HolidayCount Method Gets the number of holidays in the holiday table
Initialize Method Defines the holiday table and its field names. Use an existing table or create it. This method must be called before using any of the class methods to work with business days. Uses ADO to support ACCDB/MDB and ADPs
IsBusinessDay Method Determine if the specified date is a business day (not in the holiday table and not a weekend day)
IsHoliday Method Determine if the specified date is a holiday (in the holiday table)
LastDayOfWeekInMonth Private Calculates the last day (Sunday, Monday, etc.) of the month
MonthBusinessDays Method Number of business days in a month
MonthFirstBusinessDay Method Calculate the first business day of the month
MonthLastBusinessDay Method Calculate the last business day of the month
NthDayOfMonth Private Returns the date of the Nth day (Monday, Tuesday, etc.) of the month
YearBusinessDays Method Number of business days in a year

Overview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources

Feedback

Contact Us  l   Web questions: Webmaster   l   Copyright © FMS, Inc., Vienna, Virginia
Celebrating our 26th Year of Software Excellence