Private Sub Command7_Click()
If Me.Status = "Review" Or Me.Status = "Assigned" Or Me.Status = "Abeyance" Or Me.Status = "Closed" Then
MsgBox "Engineering Request can not be 'CANCELLED'." & vbCrLf & "Status must be 'Submitted' or 'Rejected'", vbOKOnly
Exit Sub
Else
If Me.Status = "CANCELLED" Then
MsgBox "Engineering Request is already 'CANCELLED'.", vbOKOnly
Exit Sub
Else
If IsNull(Me.Name_Cancel) Or IsNull(Me.[Date Cancelled]) Or IsNull(Me.Cancel_Reason) Then
MsgBox "You must enter a Name, Date and Reason for the cancellation!", vbOKOnly
Exit Sub
Else
If Me.Name_Cancel = Me.Originator Then
If MsgBox("Are you sure you wish to cancel this Engineering Request?", vbYesNo, "Warning") = vbYes Then
Me.Status = "CANCELLED"
DoCmd.RunCommand acCmdRefresh
Me.Refresh
Else
End If
Else
If MsgBox("This is not the same person as the originator." & vbCrLf & "Do you wish to continue?", vbYesNo, "Warning") = vbYes Then
Me.Status = "CANCELLED"
DoCmd.RunCommand acCmdRefresh
Me.Refresh
Else
End If
End If
End If
End If
End If
End Sub