If Forms!caloriesbyactivityform!Age = 0 Then
MsgBox "You must enter your Age in Years"
Forms!caloriesbyactivityform![Age].SetFocus
Exit Sub
End If
If Forms!caloriesbyactivityform!feet = 0 Then
MsgBox "You must enter your Height in Feet and Inches"
Forms!caloriesbyactivityform![feet].SetFocus
Exit Sub
End If
If Forms!caloriesbyactivityform!weight = 0 Then
MsgBox "You must enter your Weight"
Forms!caloriesbyactivityform![weight].SetFocus
Exit Sub
End If
If Forms!caloriesbyactivityform!Duration = 0 Then
MsgBox "You must enter a Duration in Minutes"
Forms!caloriesbyactivityform![Duration].SetFocus
Exit Sub
End If
If Forms!caloriesbyactivityform!Male = True Then
MyAge = Forms!caloriesbyactivityform!Age
MyHeight = ((Forms!caloriesbyactivityform!feet * 12) + Forms!caloriesbyactivityform!inches) * 2.54
MyWeight = Forms!caloriesbyactivityform!weight / 2.2
MyBMR = 66 + (13.7 * MyWeight) + (5 * MyHeight) - (6.8 * MyAge)
Forms!caloriesbyactivityform!BMR = MyBMR
Else
MyAge = Forms!caloriesbyactivityform!Age
MyHeight = ((Forms!caloriesbyactivityform!feet * 12) + Forms!caloriesbyactivityform!inches) * 2.54
MyWeight = Forms!caloriesbyactivityform!weight / 2.2
MyBMR = 655 + (9.6 * MyWeight) + (1.8 * MyHeight) - (4.7 * MyAge)
Forms!caloriesbyactivityform!BMR = MyBMR
End If
StField = Me.metID
MyCriteria = "[metID] = " & StField
METValue = DLookup("[metnumber]", "MetabolicEquivalents", MyCriteria)
ItemSValue = DLookup("[listing]", "MetabolicEquivalents", MyCriteria)
MyMetValue = METValue * (MyBMR / 1440) * Forms!caloriesbyactivityform!Duration
Forms!caloriesbyactivityform!METValue1 = METValue
Forms!caloriesbyactivityform!Burned = MyMetValue
Forms!caloriesbyactivityform!ItemSelected = ItemSValue
|