santastefano
Programmer
My problem is writing a loop within a loop (for holiday check) and resetting the date to date+7 after an adjustment for holidays
The first loop works perfectly
The holiday table is a table of individual dates
My problem is the breakout to check for holidays and resetting the variable
I have been struggling with this for some time and I would be happy to pay any reasonable fee for a working solution AND PUBLISH THE SOLUTION HERE for any other users with a similar problem.
The first loop works perfectly
Code:
ElseIf varSessionsPerWeek = 1 Then
varSessionsTotal = Forms!frmCourseStart!TotalSessions
varCode = Forms!frmCourseStart!Code
varStartDate = Forms!frmMultiSession!Date1
Do While varSessionsTotal > 0
With rsTimeTable
.AddNew 'Creates new record in the table
!Code = varCode
!StartDate = varStartDate
!From = varTime1
!To = varTime2
.Update 'Confirms the record to the table.
End With
varSessionsTotal = varSessionsTotal - 1
varStartDate = varStartDate + 7
Loop
My problem is the breakout to check for holidays and resetting the variable
I have been struggling with this for some time and I would be happy to pay any reasonable fee for a working solution AND PUBLISH THE SOLUTION HERE for any other users with a similar problem.