J
John
Below is my current code for October's reporting. It is a project form
showing planned progress (OctPlan), actual progress (OctAct) and via the
attached code, an indicator and color for October (OctInd). This code works
great (thanks to the help on here) However, my form shows all 12 months, so
the code currently causes future months to indicate red. Is there a an If
then type statement that I can place this current code into that will
basically say If OctAct is null then OctInd = N/A? or is null ruined based
on the the code? Is there some other procedure I can try? I've tried using
dates to no avail. This may be due to my lack syntax knowledge.
Private Sub PEPOctAct_AfterUpdate()
On Error Resume Next
If Me.PEPOctAct > 0.0001 Then
Me.PEPOctAct = Me.PEPOctAct / 100
End If
Dim dblPercentage As Double
dblPercentage = (Me.PEPOctAct.Value / Me.PEPOctPlan.Value) * 100
Select Case dblPercentage
Case 80 To 95
Me.PEPOctInd.Value = "Y"
Me.PEPOctInd.BackColor = vbYellow
Case Is < 80
Me.PEPOctInd.Value = "R"
Me.PEPOctInd.BackColor = vbRed
Case Is >= 95
Me.PEPOctInd.Value = "G"
Me.PEPOctInd.BackColor = vbGreen
End Select
If Me.PEPOctPlan < 0.0001 Then
Me.PEPOctInd.Value = "N/A"
End If
showing planned progress (OctPlan), actual progress (OctAct) and via the
attached code, an indicator and color for October (OctInd). This code works
great (thanks to the help on here) However, my form shows all 12 months, so
the code currently causes future months to indicate red. Is there a an If
then type statement that I can place this current code into that will
basically say If OctAct is null then OctInd = N/A? or is null ruined based
on the the code? Is there some other procedure I can try? I've tried using
dates to no avail. This may be due to my lack syntax knowledge.
Private Sub PEPOctAct_AfterUpdate()
On Error Resume Next
If Me.PEPOctAct > 0.0001 Then
Me.PEPOctAct = Me.PEPOctAct / 100
End If
Dim dblPercentage As Double
dblPercentage = (Me.PEPOctAct.Value / Me.PEPOctPlan.Value) * 100
Select Case dblPercentage
Case 80 To 95
Me.PEPOctInd.Value = "Y"
Me.PEPOctInd.BackColor = vbYellow
Case Is < 80
Me.PEPOctInd.Value = "R"
Me.PEPOctInd.BackColor = vbRed
Case Is >= 95
Me.PEPOctInd.Value = "G"
Me.PEPOctInd.BackColor = vbGreen
End Select
If Me.PEPOctPlan < 0.0001 Then
Me.PEPOctInd.Value = "N/A"
End If