Re: Recurrence loop in VB6 - weekly portion by Saga
Saga
Wed Oct 15 09:38:08 CDT 2008
Instead of
> For today = DateSerial(2008, 10, 14) To DateSerial(2008, 10, 31)
could it also be expressed like so?
> For today = #10/14/2008# To #10/31/2008#
Saga
--
"Larry Serflaten" <serflaten@usinternet.com> wrote in message
news:eV8kuxrLJHA.1160@TK2MSFTNGP04.phx.gbl...
>
> "WB" <none> wrote in message news:ur9wvImLJHA.4772@TK2MSFTNGP03.phx.gbl...
>> Ok, so I am biting the bullet and creating my own recurrence patterns. I am
>> stuck on the loop for a weekly recurrence where multiple days are selected
>> (i.e. Sunday, Wed, Thur). I have a start date and an end date so I know how
>> many times to loop, but I can't figure out how to handle the days. So if
>> the days selected are Sunday and Thursday and the start date is 10/14/08 and
>> end date is 10/31/08 the end pattern should be Thursday 10/16/08, Sunday
>> 10/19/08, Thursday 10/23/08, Sunday 10/26/08, and Thursday 10/30/08.
>>
>> Any suggestions are appreciated.
>
>
> See if this gets you farther along...
>
> LFS
>
> Dim weekly(1 To 7) As Boolean
> Dim today As Date
>
> 'Sunday, Thursday
> Erase weekly
> weekly(vbSunday) = True
> weekly(vbThursday) = True
>
> For today = DateSerial(2008, 10, 14) To DateSerial(2008, 10, 31)
> If weekly(WeekDay(today)) Then
> Debug.Print Format$(today, "dddd mm/dd/yyyy")
> End If
> Next
>
>