I have this code which puts correct dates on msflexgrid control for weekly rotas on my program. What it currently does is checks which day is monday and the loops it through creating dates accordingly to as monday, tuesday etc.
now I have a problem trying to create a rota for 2 weeks instead of one. if i just copy the code it will work for the time being but as soon as that week is over both rotas just skip a whole week instead of running like 14 days. 1 , 2 , 3 , 4 .... 14 and then loop both rotas on to staring 15 (monday) 16, 17 , 28 etc.
grdRota is msflexgrid1.
now I have a problem trying to create a rota for 2 weeks instead of one. if i just copy the code it will work for the time being but as soon as that week is over both rotas just skip a whole week instead of running like 14 days. 1 , 2 , 3 , 4 .... 14 and then loop both rotas on to staring 15 (monday) 16, 17 , 28 etc.
Code:
Dim f As Integer
dim tDate as Date
tDate = now
For f = 1 To 7
tDate = Format(tDate, "d/m/yy")
grdRota.TextMatrix(1, f) = DateAdd("d", f - 1, tDate)
Next f
Comment