On my form I have a calculated value text box which is the sum of 5 text boxes. I have three error messages which I want to appear "high risk" "low risk" and "medium risk" depending on the value in the calculated text box. I have these error messages as labels on the form and when the form loads they are made not visible.
I want the messages to appear as the "calculate" button I have is clicked. Currently I only the last error message in the code appears when the button is clicked and the value is within the range specified. I feel like its something simple that I am missing but cant figure it out.
I want the messages to appear as the "calculate" button I have is clicked. Currently I only the last error message in the code appears when the button is clicked and the value is within the range specified. I feel like its something simple that I am missing but cant figure it out.
Code:
Private Sub Command43_Click()
txtcalculate.Value = CDbl(Nz([txt1], 0)) + CDbl(Nz([txt2], 0)) + CDbl(Nz([txt3], 0)) + CDbl(Nz([txt4], 0)) + CDbl(Nz([txt5], 0))
If txtscalculate.Value <= 16 Then
Me.lbllow.Visible = True
End If
If txtcalculate.Value >= 34 Then
Me.lblhigh.Visible = True
End If
If txtcalculate.Value = 17 - 33 Then
Me.lblmedium.Visible = True
End If
End Sub
Comment