VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Advanced Begin & End Date Calculations Simplified

Chad M. Kovac  (4 Submissions)   Microsoft Office Apps/VBA   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Allows calculation of Begin or End dates based upon the RANGE (Week, Month, Year), the DATE to use as the source or comparison date and PREV or CURRENT range. Examples:
'BeginDateCalc("W","P",#11/15/2000#) returns: 11/5/00 as the first day or the PREVIOUS WEEK is Sunday the 5th. You could easily modify the code to allow the last day of the week to be any day you wish.
'BeginDateCalc("M","P",#11/15/2000#) = 10/1/00
'BeginDateCalc("M","C",#11/15/2000#) = 11/1/00
'BeginDateCalc("Wm","C",#11/15/2000#) = 11/1/00 'Wm is used to tell us Week but Month limited. 'Notice the same with "W" instead of "Wm" would result in 10/29/00

Inputs
Range, Calculation, Date

Assumes
'Public Domain: This code may be used and distributed freely as long as header remains unchanged. 'The person(s) supplying this code can not be held liable for use, misuse or damage caused by the use of this code. 'Written by Chad M. Kovac 'CEO, Tech Knowledgey, Inc. '[email protected] 'http://www.TechKnowledgeyInc.com '10/04/00 MS Access 97/2000

Returns
Caculated Date

API Declarations
Created for use in VBA with MS Access.

Rate Advanced Begin & End Date Calculations Simplified (3(3 Vote))
Advanced Begin & End Date Calculations Simplified.bas

Advanced Begin & End Date Calculations Simplified Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters