J
John
I have an unbound text box ("tbxRating") within the detail section of a
report. I want the value in this text box to change based on a calculation
of other text boxes within the same detail section. The report includes
multiple measures (each has its own details section with "tbxRating") as
designed, but the result within this text box is only accurate for the first
measure. All other measures are erroniously receiving the same adjectival
rating as the first measure regardless of their performance to target.
Specifically the text box ("tbxRating") indicates an adjectival rating based
on actual performance ("txtTotalPct") (%) being equal to or greater than a
target ("ExcellentTarget") (%).
Help is appreciated to get each measure's "tbxRating" to calculate on it's
results and target.
-----Begin code
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Me.txtTotalPct.Value >= Me![OutstandingTarget].Value Then
Me![tbxRating] = "Outstanding"
ElseIf Me.txtTotalPct.Value >= Me.ExcellentTarget.Value Then
Me![tbxRating] = "Excellent"
ElseIf Me.txtTotalPct.Value >= Me.GoodTarget.Value Then
Me![tbxRating] = "Good"
ElseIf Me.txtTotalPct.Value >= Me.MarginalTarget.Value Then
Me![tbxRating] = "Marginal"
ElseIf Me.txtTotalPct.Value < Me.MarginalTarget.Value Then
Me![tbxRating] = "Unsatisfactory"
End If
End Sub
-----End code
report. I want the value in this text box to change based on a calculation
of other text boxes within the same detail section. The report includes
multiple measures (each has its own details section with "tbxRating") as
designed, but the result within this text box is only accurate for the first
measure. All other measures are erroniously receiving the same adjectival
rating as the first measure regardless of their performance to target.
Specifically the text box ("tbxRating") indicates an adjectival rating based
on actual performance ("txtTotalPct") (%) being equal to or greater than a
target ("ExcellentTarget") (%).
Help is appreciated to get each measure's "tbxRating" to calculate on it's
results and target.
-----Begin code
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Me.txtTotalPct.Value >= Me![OutstandingTarget].Value Then
Me![tbxRating] = "Outstanding"
ElseIf Me.txtTotalPct.Value >= Me.ExcellentTarget.Value Then
Me![tbxRating] = "Excellent"
ElseIf Me.txtTotalPct.Value >= Me.GoodTarget.Value Then
Me![tbxRating] = "Good"
ElseIf Me.txtTotalPct.Value >= Me.MarginalTarget.Value Then
Me![tbxRating] = "Marginal"
ElseIf Me.txtTotalPct.Value < Me.MarginalTarget.Value Then
Me![tbxRating] = "Unsatisfactory"
End If
End Sub
-----End code