<-- Previous || Up || Next -->

Next Day Of Week On Or After Function
Dates Times Class

Public Function NextDayOfWeekOnOrAfter( _
      ByVal vDate As Variant _
    , ByVal vDayOfWeek As Variant _
    ) As Variant

Returns the date of the current or next specific day of the week (for example, the current or next Saturday).
Function returns the date component of vDate if it is the same day of the week as vDayOfWeek.

Examples:
    Format$(#4/15/1996#, "ddd") = "Mon"
    NextDayOfWeekOnOrAfter(#4/15/1996#, vbMonday)  = #4/15/1996#
    NextDayOfWeekOnOrAfter(#4/15/1996#, vbTuesday) = #4/16/1996#
    NextDayOfWeekOnOrAfter(#4/15/1996#, vbFriday)  = #4/19/1996#
    NextDayOfWeekOnOrAfter(#4/15/1996#, vbMonday)  = #4/15/1996#
    NextDayOfWeekOnOrAfter(#4/15/1996#, vbSunday)  = #4/21/1996#
    NextDayOfWeekOnOrAfter(#4/15/1996#, #3/31/1996#)  = #4/21/1996#
See also:
    NextDayOfWeek Function
    PreviousDayOfWeekOnOrBefore Function
    vbSunday Property, et. al.
vDate: The date whose current or next specific day of the week is returned. Function returns Null if vDate is Null or cannot be fixed up to a Date.
vDayOfWeek: Date or numeric value which represents the day of the week (Sunday, Monday, etc.). Function returns Null if vDayOfWeek is Null or cannot be fixed up to either a date or a number. Function first checks numeric values to see if they are one of the vb constants that represent the days of the week (vbSunday, vbMonday, vbTuesday, vbWednesday, vbThursday, vbFriday, or vbSaturday). Otherwise, numeric values are interpreted as date values. Function examines the date component of date/time values to determine its weekday.
Note:
    LastDayOfWeek = NextDayOfWeekOnOrAfter(vDate, vbSaturday)

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.