hi i am having a big trouble with calendar control and msflexgrid. my objective is when the date is selected it would add onto the grid on the right collum such as if the date selected is 01/05/2008 (Thursday) once selected it would display onto the grid as following. the grid is 9 collums wide. this is how the rota looks like. i want the code to identify the column and display it on the right column. the problem is of my code is that when the date changes it moves forward the days. like Monday - 28/04/08 that changes to 29/04/08.
......................................................................................................................................................................
name/Day....Monday....Tuesday....Wednesday....thursday....Friday....Saturday....Sunday....Total Hours
Date............28/04/08...29/04/08.....30/04/08.......1/05/08......2/05/08....3/05/08.....4/05/08
Name
Name
Name
........................................................................................................................................................................
My sample code. I did not use the calendar control yet because I dont know how. I would be really appreciated if you guys could help me out. thanks in advance
Dim a As Integer
For a = 1 To 7
grdRota.TextMatrix(a, 1) = Date - 3
Next a
For a = 1 To 7
grdRota.TextMatrix(a, 2) = Date - 2
Next a
For a = 1 To 7
grdRota.TextMatrix(a, 3) = Date - 1
Next a
For a = 1 To 7
grdRota.TextMatrix(a, 4) = Date
Next a
For a = 1 To 7
grdRota.TextMatrix(a, 5) = Date + 1
Next a
For a = 1 To 7
grdRota.TextMatrix(a, 6) = Date + 2
Next a
For a = 1 To 7
grdRota.TextMatrix(a, 7) = Dat