N
Nicholas Scarpinato
I've read about 50 examples of how to use Conditional Formatting to change
the color of specific fields in a continuous form. Is there a way to use it
to change the form's background color for that particular record, while
leaving the records that are have not met the condition in their normal
format? What I'm attempting to do is build a form that shows all of the users
who are out on break, with their "Out" time and their "Due In" time. I want
to display the users who have not passed their "Due In" with a green
background, and the ones who have passed that time with a red background. I
can get one or the other, but it all depends on the first record in the form.
If the first record in the form meets the "lapsed" criteria, the entire
subform displays with the red background, and vice versa. Can this be done
with a continuous form, or do I need to look into another way to attempt this?
Here is my code... part of my problem is I'm not real sure where to put this
code so that it runs on every record, or if I've even got it written
correctly:
If DateDiff("m", Me!DueTime, Now()) > 15 Then
PastClockTime = 1
Else
PastClockTime = 2
End If
Select Case PastClockTime
Case 1
Me.Detail.BackColor = 1643706
Me.Label1.ForeColor = 16777215
Me.Label3.ForeColor = 16777215
Me.Label5.ForeColor = 16777215
Me.Label7.ForeColor = 16777215
Case 2
Me.Detail.BackColor = 16777215
Me.Label1.ForeColor = 0
Me.Label3.ForeColor = 0
Me.Label5.ForeColor = 0
Me.Label7.ForeColor = 0
End Select
Any help is much appreciated. Thanks!
the color of specific fields in a continuous form. Is there a way to use it
to change the form's background color for that particular record, while
leaving the records that are have not met the condition in their normal
format? What I'm attempting to do is build a form that shows all of the users
who are out on break, with their "Out" time and their "Due In" time. I want
to display the users who have not passed their "Due In" with a green
background, and the ones who have passed that time with a red background. I
can get one or the other, but it all depends on the first record in the form.
If the first record in the form meets the "lapsed" criteria, the entire
subform displays with the red background, and vice versa. Can this be done
with a continuous form, or do I need to look into another way to attempt this?
Here is my code... part of my problem is I'm not real sure where to put this
code so that it runs on every record, or if I've even got it written
correctly:
If DateDiff("m", Me!DueTime, Now()) > 15 Then
PastClockTime = 1
Else
PastClockTime = 2
End If
Select Case PastClockTime
Case 1
Me.Detail.BackColor = 1643706
Me.Label1.ForeColor = 16777215
Me.Label3.ForeColor = 16777215
Me.Label5.ForeColor = 16777215
Me.Label7.ForeColor = 16777215
Case 2
Me.Detail.BackColor = 16777215
Me.Label1.ForeColor = 0
Me.Label3.ForeColor = 0
Me.Label5.ForeColor = 0
Me.Label7.ForeColor = 0
End Select
Any help is much appreciated. Thanks!