I have a text box with a DLookup that will return "Not Found" or a Number > 0 when it loses focus. Below is the code I am using
I keep getting the compile error Else without If, any help is greatly appreciated.....
I keep getting the compile error Else without If, any help is greatly appreciated.....
Code:
Private Sub txtCodingBatch_LostFocus()
Dim vTempCodingEntryBatchVerify As String
vTempCodingEntryBatchVerify = Nz(DLookup("CountOfAccession", "QryCodingEntryBatchVerify"), "Not Found")
Me![txtCodingEntryVerifyBatch] = vTempCodingEntryBatchVerify
If Me![txtCodingEntryVerifyBatch] = "Not Found" Then MsgBox "Invalid Batch, Please ReEnter Valid Batch Number"
Me![txtCodingBatch].SetFocus
ElseIf Me![txtCodingEntryVerifyBatch] <> "Not Found" Then Me![txtDateSignedOutToCoding].SetFocus
End If
End Sub