I have a table that holds various schedules. Each schedule has a different number of weeks in length. For example, say I've selected a schedule that is 3-weeks long. I want to generate a report that shows the schedule over a 52-week period. That means the query would repeat itself 18 times.
The query is...
SELECT * FROM tblSCHED WHERE SchedID="ScheduleA"
ORDER BY IIf([WkNUM]>=LineNUM(),0,1), WkNum
Note: The 'IIf' statement ensures that the schedule begins from a selected week number then loops back to the top. This is different than what I'm asking. Not only do I need it to loop, but repeat the cycle 'n' number of times.
The "tblSCHED" table has the following fields...
SchedID[tab](unique identifier for each schedule)
WkNum[tab](each week is sequentially numbered beginning at 1)
MonSHIFT[tab](shift code or null if day off)
TueSHIFT[tab](shift code or null if day off)
WedSHIFT[tab](shift code or null if day off)
ThuSHIFT[tab](shift code or null if day off)
FriSHIFT[tab](shift code or null if day off)
SatSHIFT[tab](shift code or null if day off)
SunSHIFT[tab](shift code or null if day off)
TotalWks[tab](total number of weeks in schedule)
To accomplish my task so far, I've created a report with 364 text boxes that are filled using VBA.
set RS = currentdb.openrecordset("qrySCHED")
for cnt = 1 to 52
[Tab]'fill boxes using me.box# = rs(field#)
[tab]rs.movenext
[tab]if rs.eof then rs.movefirst
next cnt
This works, but is slow. I would like to find a way for the query to be made to repeat itself rather that using VBA and manually creating 364 text boxes on a report.
Any suggestions?
Thanks.
The query is...
SELECT * FROM tblSCHED WHERE SchedID="ScheduleA"
ORDER BY IIf([WkNUM]>=LineNUM(),0,1), WkNum
Note: The 'IIf' statement ensures that the schedule begins from a selected week number then loops back to the top. This is different than what I'm asking. Not only do I need it to loop, but repeat the cycle 'n' number of times.
The "tblSCHED" table has the following fields...
SchedID[tab](unique identifier for each schedule)
WkNum[tab](each week is sequentially numbered beginning at 1)
MonSHIFT[tab](shift code or null if day off)
TueSHIFT[tab](shift code or null if day off)
WedSHIFT[tab](shift code or null if day off)
ThuSHIFT[tab](shift code or null if day off)
FriSHIFT[tab](shift code or null if day off)
SatSHIFT[tab](shift code or null if day off)
SunSHIFT[tab](shift code or null if day off)
TotalWks[tab](total number of weeks in schedule)
To accomplish my task so far, I've created a report with 364 text boxes that are filled using VBA.
set RS = currentdb.openrecordset("qrySCHED")
for cnt = 1 to 52
[Tab]'fill boxes using me.box# = rs(field#)
[tab]rs.movenext
[tab]if rs.eof then rs.movefirst
next cnt
This works, but is slow. I would like to find a way for the query to be made to repeat itself rather that using VBA and manually creating 364 text boxes on a report.
Any suggestions?
Thanks.