Public Sub TTargetStatusCFL()
Dim CurrentDate As String, LValue As Integer, Target As String, Days As Integer
CurrentDate = Format(Date, "Short Date")
LValue = DateDiff("d", CurrentDate, #12/31/2009#)
Days = 365 - LValue
Target = (Reports![RptTeamSchemeKTCO2Performance09]![TCFLTarget09] / 365) * Days
If Reports![RptTeamSchemeKTCO2Performance09]![TCFL] >= Target Then
Reports![RptTeamSchemeKTCO2Performance09]![LabelCFLAbove].Visible = True
Reports![RptTeamSchemeKTCO2Performance09]![LabelCFLBelow].Visible = False
End If
If Reports![RptTeamSchemeKTCO2Performance09]![TCFL] < Target Then
Reports![RptTeamSchemeKTCO2Performance09]![LabelCFLAbove].Visible = True
Reports![RptTeamSchemeKTCO2Performance09]![LabelCFLBelow].Visible = False
End If
End Sub
TCFL is returning a value of 9 (this is correct)
Target is returning a value of 26 (this is correct)
But the >= is not working
for you info the 26 is inclosed in "26" where as the 9 is not
can someone help
Dim CurrentDate As String, LValue As Integer, Target As String, Days As Integer
CurrentDate = Format(Date, "Short Date")
LValue = DateDiff("d", CurrentDate, #12/31/2009#)
Days = 365 - LValue
Target = (Reports![RptTeamSchemeKTCO2Performance09]![TCFLTarget09] / 365) * Days
If Reports![RptTeamSchemeKTCO2Performance09]![TCFL] >= Target Then
Reports![RptTeamSchemeKTCO2Performance09]![LabelCFLAbove].Visible = True
Reports![RptTeamSchemeKTCO2Performance09]![LabelCFLBelow].Visible = False
End If
If Reports![RptTeamSchemeKTCO2Performance09]![TCFL] < Target Then
Reports![RptTeamSchemeKTCO2Performance09]![LabelCFLAbove].Visible = True
Reports![RptTeamSchemeKTCO2Performance09]![LabelCFLBelow].Visible = False
End If
End Sub
TCFL is returning a value of 9 (this is correct)
Target is returning a value of 26 (this is correct)
But the >= is not working
for you info the 26 is inclosed in "26" where as the 9 is not
can someone help