Good Afternoon all;
I am getting an a Compile Error: 'Block If Without End If' in the below code :banghead::
I can't seem to find where I am missing the 'End if' from my code, was hoping a fresh pair of eyes would help.
Kind Regards
Tor Fey
I am getting an a Compile Error: 'Block If Without End If' in the below code :banghead::
Code:
Private Sub Processbutton_Click()
If Me.RiskGrand = 0 Then
MsgBox "The Case has not been risk tested yet", vbExclamation, "RISK ASSESSMENT REQUIRED"
Exit Sub
End If
If Me.RiskGrand <= 154 Then
If MsgBox("You are about to finalise this record as a Low Risk. You will be unable to edit it" & vbCrLf & vbCrLf & "Do you want to continue?", vbQuestion + vbYesNo, "SIGN OFF") = vbNo Then
Exit Sub
Else
Me.TF_Ben_Outcome = "Low Risk, NFA"
Me.TF_Ben_Outcome_Date = Date
Me.TF_Ben_Outcome_By = CurrentUser()
End If
End If
If Me.RiskGrand <= 154 Then
If MsgBox("You are about to finalise this record as a Low Risk. You will be unable to edit it" & vbCrLf & vbCrLf & "Do you want to continue?", vbQuestion + vbYesNo, "SIGN OFF") = vbNo Then
Exit Sub
End If
If Me.RiskGrand >= 155 And Me.RiskGrand <= 189 Then
MsgBox "Medium Risk"
End If
If Me.TF_Ben_NI_Number > 9 Then
MsgBox "Please Change The NI Number To 9 Digits", vbInformation, "NI Number Can Only Be 9 Digits"
Me.TF_Ben_NI_Number.SetFocus
Exit Sub
If Me.RiskGrand > 189 Then
If MsgBox("You are about to finalise this record and create an Investigation Case." & vbCrLf & vbCrLf & "Do you want to continue?", vbQuestion + vbYesNo, "SIGN OFF") = vbNo Then
Exit Sub
Else
Me.TF_Ben_Outcome = "High Risk, Case created"
Me.TF_Ben_Outcome_Date = Date
Me.TF_Ben_Outcome_By = CurrentUser()
DoCmd.SetWarnings False
DoCmd.OpenQuery "Qry_TF_Ben_PrelimtoMain", acViewNormal, acEdit
DoCmd.SetWarnings True
DoCmd.Close acForm, "frm_tf_ben_IUO1"
End If
If MsgBox("DO YOU WANT TO OPEN MAIN RECORD? " & vbCrLf, vbYesNo) = vbYes Then
DoCmd.OpenForm "frm_tf_ben_main", acNormal, "", "[tbl_tf_ben_main]![tf_ben_id]=[form]![frm_tf_ben_IUO1]![tf_ben_id]", , acNormal
DoCmd.Close acForm, "frm_tf_ben_IUO1"
Else
DoCmd.Close acForm, "frm_tf_ben_IUO1"
End If
End Sub
Kind Regards
Tor Fey
Last edited: