J
joseph
Good morning,
I tried to follow the code that was provided in a previous post and I came
up w/ the
following for my db ... (what I'm looking to do is I have a report that
contains about 10 fields, of which, I have a field known as "Date Oath
Received" ... if that field is blank in my report I would like to color code
the entire row yellow, if not, it can be default (white). I would also like
to color code the row red if there is a date
populated in that field "Date Oath Received" that is more than 30 days from
the date in the "Date of Appointment" field
This is what I have so far and nothing happens:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'this is where I would like to identify specific colors
'for certain items on a report
'------------------------------------------------------
'If the date oath was received is beyond 30 days from
'date of authentication, color = red
'------------------------------------------------------
'if the no oath of office has been received
'color = yellow
'------------------------------------------------------
If Me.[Date Oath Received] >= Date And Me.[Date of Appointment] <=
DateAdd("d", -30, Date) Then
Me.[Date Oath Received].BackColor = vbRed
Else
Me.[Date Oath Received].BackColor = vbWhite
End If
Dim C As Control
For Each C In Me.Section(0).Controls
If TypeOf C Is TextBox Or TypeOf C Is Label Then
C.BackColor = Me.[Date Oath Received].BackColor
End If
Next
End Sub
any help would be most awesome!
Thank you,
Joseph
I tried to follow the code that was provided in a previous post and I came
up w/ the
following for my db ... (what I'm looking to do is I have a report that
contains about 10 fields, of which, I have a field known as "Date Oath
Received" ... if that field is blank in my report I would like to color code
the entire row yellow, if not, it can be default (white). I would also like
to color code the row red if there is a date
populated in that field "Date Oath Received" that is more than 30 days from
the date in the "Date of Appointment" field
This is what I have so far and nothing happens:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'this is where I would like to identify specific colors
'for certain items on a report
'------------------------------------------------------
'If the date oath was received is beyond 30 days from
'date of authentication, color = red
'------------------------------------------------------
'if the no oath of office has been received
'color = yellow
'------------------------------------------------------
If Me.[Date Oath Received] >= Date And Me.[Date of Appointment] <=
DateAdd("d", -30, Date) Then
Me.[Date Oath Received].BackColor = vbRed
Else
Me.[Date Oath Received].BackColor = vbWhite
End If
Dim C As Control
For Each C In Me.Section(0).Controls
If TypeOf C Is TextBox Or TypeOf C Is Label Then
C.BackColor = Me.[Date Oath Received].BackColor
End If
Next
End Sub
any help would be most awesome!
Thank you,
Joseph