Here is the FOR...LOOP construct I am using successfully:
.....
FOR Week as integer = 1 to WeekCount '' what if its one week and WeekCount = 0?? Does the loop fire once at least?
newrate = cSng(WeekCounter.text) + 1 ' or to create a loop that calcs it once correctly, including W,1,B SOL freq
WeekCounter.text = newrate.tostring
ForDate = Microsoft.VisualBasic.DateAdd("d", ((Week-1) * 7) , ForStartDate )
IF FirstOfYear <= ForDate and ForDate <= StartDateParm then
if UpperOther1 <> "W" then ' will this with the W and w?
if ( UpperOther1 = "B" AND ( Microsoft.VisualBasic.DATEDIFF("d", ForStartDate, ForDate) MOD 14 = 0 ) ) OR _
( UpperOther1 = "1" AND ( Microsoft.VisualBasic.DATEDIFF("d", ForStartDate, ForDate) MOD 28 = 0 ) ) then
wkly = SngRate
else
wkly = 0.0
end if
end if
newrate = cSng(ClassYTDRevenue.text) + wkly ' or to create a loop that calcs it once correctly, including W,1,B SOL freq
ClassYTDRevenue.text = newrate.tostring
newrate = cSng(TotalYTDRevenue.text) + wkly ' or to create a loop that calcs it once correctly, including W,1,B SOL freq
TotalYTDRevenue.text = newrate.tostring
END IF
NEXT
.....