Hello! I am trying to create code that looks at the time and highlights it if it is either under or over the goal times indicated.
Here is my code in the "On Print":
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim goal As Date
goal = CDate(Format(txtDailyMinimumGoal))
Debug.Print goal
Debug.Print Me!txtDailyMinimumGoal
If CDate(Me!txtBreak) < goal Then
Me!txtBreak.BackColor = 14935011
Else
Me!txtBreak.BackColor = 16777215
End If
Dim goal As Date
goal = CDate(Format(txtDailyMaximumGoal))
If CDate(Me!txtBreak) > goal Then
Me!txtBreak.BackColor = 14935011
Else
Me!txtBreak.BackColor = 16777215
End If
End Sub
Unfortunately, it only highlights the first set of code - so I need to somehow combine the two. Can anyone assist?
Here is my code in the "On Print":
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim goal As Date
goal = CDate(Format(txtDailyMinimumGoal))
Debug.Print goal
Debug.Print Me!txtDailyMinimumGoal
If CDate(Me!txtBreak) < goal Then
Me!txtBreak.BackColor = 14935011
Else
Me!txtBreak.BackColor = 16777215
End If
Dim goal As Date
goal = CDate(Format(txtDailyMaximumGoal))
If CDate(Me!txtBreak) > goal Then
Me!txtBreak.BackColor = 14935011
Else
Me!txtBreak.BackColor = 16777215
End If
End Sub
Unfortunately, it only highlights the first set of code - so I need to somehow combine the two. Can anyone assist?