FRM
Member
End If Error
while if Sub is being underlined.
Please can someone help me with this. I am to give the category of Blood Pressure using the Systolic and diastolic BP. I just do not know where my End If is missing
Private Sub btnCalBP_Click
If IsNumber(edtSystolic.Text) = False Then
edtDisBP.Text = "Please enter valid Systolic Value"
Return
Else If IsNumber(edtDiastolic.Text) = False Then 'check user typed number
edtDiastolic.Text = "Please enter valid Diastolic Value"
Return
End If
If edtSystolic.Text < 80 Then 'to prevent divide-by-zero in BMI calculation
edtDisBP.Text = "Length seems very short "
Return
Else
If edtSystolic.Text <50 Then
edtDisBP.Text = "Enter Valid Weight"
End If
End If
If edtSystolic.Text < edtDiastolic.Text Then
edtDisBP.Text= "Invalid Values"
End If
Dim BPWords As String
If (edtSystolic.Text <120) & (edtDiastolic.Text < 80) Then
BPWords = "Normal"
Else
If (edtSystolic.Text < 140 ) Or (edtDiastolic.Text < 90) Then
BPWords = "Prehypertension"
If (edtSystolic.Text < 159) Or (edtDiastolic.Text < 100) Then
BPWords = "High Blodd Pressure"
Else
If (edtSystolic.Text > 160 ) Or (edtDiastolic.Text > 100) Then
BPWords = "High Blodd Pressure (Hypertension Stage 2)"
Else
edtDisBP.Text = "Hypertensive Crisis (EMERGENCY CARE NEEDED)"
End If
End If
edtDisBP.Text = BPWords & " "
End Sub
while if Sub is being underlined.
Please can someone help me with this. I am to give the category of Blood Pressure using the Systolic and diastolic BP. I just do not know where my End If is missing
Private Sub btnCalBP_Click
If IsNumber(edtSystolic.Text) = False Then
edtDisBP.Text = "Please enter valid Systolic Value"
Return
Else If IsNumber(edtDiastolic.Text) = False Then 'check user typed number
edtDiastolic.Text = "Please enter valid Diastolic Value"
Return
End If
If edtSystolic.Text < 80 Then 'to prevent divide-by-zero in BMI calculation
edtDisBP.Text = "Length seems very short "
Return
Else
If edtSystolic.Text <50 Then
edtDisBP.Text = "Enter Valid Weight"
End If
End If
If edtSystolic.Text < edtDiastolic.Text Then
edtDisBP.Text= "Invalid Values"
End If
Dim BPWords As String
If (edtSystolic.Text <120) & (edtDiastolic.Text < 80) Then
BPWords = "Normal"
Else
If (edtSystolic.Text < 140 ) Or (edtDiastolic.Text < 90) Then
BPWords = "Prehypertension"
If (edtSystolic.Text < 159) Or (edtDiastolic.Text < 100) Then
BPWords = "High Blodd Pressure"
Else
If (edtSystolic.Text > 160 ) Or (edtDiastolic.Text > 100) Then
BPWords = "High Blodd Pressure (Hypertension Stage 2)"
Else
edtDisBP.Text = "Hypertensive Crisis (EMERGENCY CARE NEEDED)"
End If
End If
edtDisBP.Text = BPWords & " "
End Sub