Private Sub MICR_Scan_BeforeUpdate(Cancel As Integer)
Dim strMIRC As String
[COLOR="Blue"] Dim strDate As Date
Dim strCriteria As String[/COLOR]
intRemarks = 0
strMIRC = Trim(ReplaceChars(Me.MICR_Scan) & "")
[COLOR="blue"] strDate = Me.Parent!PDCDueDate
strCriteria = "MICR_ndt = '" & strMIRC & "' And PDC_dueDate = #" & strDate & "#"[/COLOR]
[COLOR="Red"]' TableField = variable And NextTableField = variable1 And lastTableField = variable2[/COLOR]
If Len(strMIRC) < 1 Then
MsgBox "Need to enter Cheque MIRC", vbExclamation + vbOKOnly
Exit Sub
End If
If DCount("1", "tbl_temp_Validate", "MICR = '" & strMIRC & "'") > 0 Then
Me.Undo
'Cancel = True
'Message box warning of duplication
MsgBox "Duplicate Cheque MICR and CreditAC already Scanned " & "" _
& vbCr & Me.MICR_Scan, vbInformation _
, " Duplicate MICR"
Exit Sub
End If
[COLOR="Red"]'----------------------------------------------------------------------------------
' If DCount("1", "tbl_Master", "MICR_ndt = '" & strMIRC & "'") < 1 Then
'----------------------------------------------------------------------------------[/COLOR]
[COLOR="Blue"] If DCount("1", "tbl_Master", strCriteria) < 1 Then[/COLOR]
Debug.Print strCriteria
'Debug.Print strDate
Me.Status.Value = "UnMatch"
Me.cboRemark = DLookup("RejectReason", "tbl_RejectReason", "SrNos = 5")
intRemarks = intRemarks + 1
'Cancel = True
'Undo duplicate entry
' Me.Undo
MsgBox "Incorrect MICR Scanned " & "" _
& vbCr & Me.MICR_Scan & " " _
& vbCr & "Kindly check and correct Scanned MICR.", vbInformation _
, " MICR Information"
End If
End Sub