In my Football League database I need to create a public function that takes a players weight, height, aage and gender and returns a players PCI BMI using the following calculation:
men: 0.5 * weight / height squared + 11.5
women: 0.4 * weight / height squared + 0.03 * age + 11
taken from www.halls.md
I have tried using the following code however i'm not sure if the code is correct and doesn't work
I have to display the output on a form
If anyone could help me out would really appreciate it, i also have to highlight players that have BMI's not in the normal range, not sure how to do this? I have to use VBA to do everything.
men: 0.5 * weight / height squared + 11.5
women: 0.4 * weight / height squared + 0.03 * age + 11
taken from www.halls.md
I have tried using the following code however i'm not sure if the code is correct and doesn't work
Code:
Public Function myCalculateBMI()
Dim intBMI As Integer
If gender = Male The=
intBMI = 0.5 * weight / height * height + 11.5
Else
intBMI = 0.4 * weight / height * height + 0.03 * age + 11
End If
myCalculateBMI = intBMI
End Function
End Sub
I have to display the output on a form
If anyone could help me out would really appreciate it, i also have to highlight players that have BMI's not in the normal range, not sure how to do this? I have to use VBA to do everything.