Hi,
I'm new to vba on access.
I'm trying to set up a calculation for a score called MELD score where MELD Score = (0.957 * ln(Creatinine) + 0.378 * ln(Bilirubin) + 1.120 * ln(INR) + 0.643 ) * 10
I've set up the coding on a command button (MELD calc) as follows:
Private Sub Meld_calc_Click()
'Stop
Dim LnCrea
LnCrea = Log(Me.Creatinine)
Debug.Print LnCrea
Dim LnTbil
LnTbil = Log(Me.Bilirubin)
Debug.Print LnTbil
Dim LnINR
LnINR = Log(Me.INR)
Debug.Print LnINR
Me.MELD = ((0.957 * LnCrea) + (0.378 * LnTbil) + (1.12 * LnINR) + 0.643) * 10
Debug.Print Me.MELD
End Sub
I get good results within a certain range of values with this but there are several problems:
1. There is a cap for Creatinine value used in the MELD score (capped at 4)
2. The total for MELD is capped at 40
3. Lower limit for each of the 3 components are set at 1
I am unable to figure out the additional coding needed to get the above requirements fulfilled
I would be extremely grateful for any suggestions.
Thanks in advance
Kuleesha
I'm new to vba on access.
I'm trying to set up a calculation for a score called MELD score where MELD Score = (0.957 * ln(Creatinine) + 0.378 * ln(Bilirubin) + 1.120 * ln(INR) + 0.643 ) * 10
I've set up the coding on a command button (MELD calc) as follows:
Private Sub Meld_calc_Click()
'Stop
Dim LnCrea
LnCrea = Log(Me.Creatinine)
Debug.Print LnCrea
Dim LnTbil
LnTbil = Log(Me.Bilirubin)
Debug.Print LnTbil
Dim LnINR
LnINR = Log(Me.INR)
Debug.Print LnINR
Me.MELD = ((0.957 * LnCrea) + (0.378 * LnTbil) + (1.12 * LnINR) + 0.643) * 10
Debug.Print Me.MELD
End Sub
I get good results within a certain range of values with this but there are several problems:
1. There is a cap for Creatinine value used in the MELD score (capped at 4)
2. The total for MELD is capped at 40
3. Lower limit for each of the 3 components are set at 1
I am unable to figure out the additional coding needed to get the above requirements fulfilled
I would be extremely grateful for any suggestions.
Thanks in advance
Kuleesha