I am new to VBA does anyone know how this SHOULD have been written... I know every IF needs an END IF and the word OR does not seem to work so how would I cover all the below... and writing an IF for each does not work. Private Sub cmbInternalStatus_Exit(Cancel As Integer) If cmbInternalStatus = "Approved" And cmbWebStatus = "Approved" Then Cancel = False If cmbInternalStatus = "Closed (Other)" And cmbWebStatus = "Closed (Other)" Then Cancel = False If cmbInternalStatus = "Director Review" And cmbWebStatus = "Functional Analysis" Then Cancel = False If cmbInternalStatus = "Disapproved" And cmbWebStatus = "Disapproved" Then Cancel = False If cmbInternalStatus = "Functional Analysis" And cmbWebStatus = "Functional Analysis" Then Cancel = False If cmbInternalStatus = "Fwd for Cmd Analysis" And cmbWebStatus = "Fwd for Cmd Analysis" Then Cancel = False If cmbInternalStatus = "Fwd for Decision" And cmbWebStatus = "Fwd for Decision" Then Cancel = False If cmbInternalStatus = "Fwd to SME" And cmbWebStatus = "Fwd to SME" Then Cancel = False If cmbInternalStatus = "Ineligible" And cmbWebStatus = "Ineligible" Then Cancel = False If cmbInternalStatus = "Pending Payment" And cmbWebStatus = "Approved" Then Cancel = False If cmbInternalStatus = "Staffing (TL Only)" And cmbWebStatus = "Approved" Then Cancel = False If cmbInternalStatus = "Team Lead Review" And cmbWebStatus = "Functional Analysis" Then Cancel = False If cmbInternalStatus = "Tech Review" And cmbWebStatus = "Functional Analysis" Then Cancel = False Else MsgBox "Internal Status does not match Web Status, please correct.", , "Silly Analyst!" Cancel = True End If End Sub
|