i have tried to piece together some code which will change the colour of a week number dependent on certain parameters. I am not a programmer, so please if it is poor,allow for the newbies on town.
Here goes. I have two cells in a report one called 'year' and one called 'weekno'. i want the code to check todays date and validate it against the 'year' and 'weekno'. If equal to or less than todays week number then change the cell colour to red. If one week on then change to blue, two weeks on green and then anything beyond that to a another colour. This is what i have done so far, but don't know how to piece the year element in. Uptil year end i would be okay but come 2007 the week number would revert to 1. thanks in adavance.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case CInt(txtWeek)
Case CInt(Format(Now(), "ww"))
Me.Section(acDetail).BackColor = vbRed
CaseCInt (Format(Now(), "ww")) + 1
Me.Section(acDetail).BackColor = vbBlue
CaseCInt (Format(Now(), "ww")) + 2
Me.Section(acDetail).BackColor = vbGreen
End Select
End Sub
Here goes. I have two cells in a report one called 'year' and one called 'weekno'. i want the code to check todays date and validate it against the 'year' and 'weekno'. If equal to or less than todays week number then change the cell colour to red. If one week on then change to blue, two weeks on green and then anything beyond that to a another colour. This is what i have done so far, but don't know how to piece the year element in. Uptil year end i would be okay but come 2007 the week number would revert to 1. thanks in adavance.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case CInt(txtWeek)
Case CInt(Format(Now(), "ww"))
Me.Section(acDetail).BackColor = vbRed
CaseCInt (Format(Now(), "ww")) + 1
Me.Section(acDetail).BackColor = vbBlue
CaseCInt (Format(Now(), "ww")) + 2
Me.Section(acDetail).BackColor = vbGreen
End Select
End Sub