Im trying to calculate a value based on input to a field, the calculation in normal terms is the following
<= 8 output is 3
=>9 but <= 11 output is 1
=>12 but <= 20 output is 0
=>21 but <=24 output is 2
>=25 output is 3
I have tried various combinations of the code below noe of which give a complete effect
Private Sub Resp_Rate_AfterUpdate()
RR = Me.Resp_Rate
If RR <= 8 Then Me.RRC = 3
If RR >= 9 <= 11 Then Me.RRC = 1
'If RR = 9 <= 11 Then Me.RRC = 1
'If RR >= 12 <= 20 Then Me.RRC = 0
'If RR >= 21 <= 24 Then Me.RRC = 2
'If RR >= 25 Then Me.RRC = 3
End Sub
RR is the input value,, RRC is where the ouput value ends up I think Im missing an else or maybe
<= 8 output is 3
=>9 but <= 11 output is 1
=>12 but <= 20 output is 0
=>21 but <=24 output is 2
>=25 output is 3
I have tried various combinations of the code below noe of which give a complete effect
Private Sub Resp_Rate_AfterUpdate()
RR = Me.Resp_Rate
If RR <= 8 Then Me.RRC = 3
If RR >= 9 <= 11 Then Me.RRC = 1
'If RR = 9 <= 11 Then Me.RRC = 1
'If RR >= 12 <= 20 Then Me.RRC = 0
'If RR >= 21 <= 24 Then Me.RRC = 2
'If RR >= 25 Then Me.RRC = 3
End Sub
RR is the input value,, RRC is where the ouput value ends up I think Im missing an else or maybe