Hi friends the following codes works fine to find the record (duplicate) but I want to display the message if the Date of Returned is Null (Filed= date_returned) How to do that , I tried with the code (stLinkCriteria = "[BOOK_FK] = " & NewID and isnull (Date_returned) in a different way but error data mismatch.
Private Sub TXTBKID_BeforeUpdate(Cancel As Integer)
Dim NewID As String
Dim stLinkCriteria As String
NewID = Me.TXTBKID.Value
stLinkCriteria = "[BOOK_FK] = " & NewID
If Me.TXTBKID = DLookup("[BOOK_FK]", "[LOAN]", stLinkCriteria) Then
MsgBox "This BOOK ID: " & [NewID] & ", Already exist taken in the Database, " _
& vbCr & vbCr & "Please Check enter the correct BOOK ID", vbInformation, "HELLO USER.... DUPLICATE INFORMATION"
Me.Undo
'undo the process and clear all fields
Me.SetFocus
End If
End Sub
Please help me
Private Sub TXTBKID_BeforeUpdate(Cancel As Integer)
Dim NewID As String
Dim stLinkCriteria As String
NewID = Me.TXTBKID.Value
stLinkCriteria = "[BOOK_FK] = " & NewID
If Me.TXTBKID = DLookup("[BOOK_FK]", "[LOAN]", stLinkCriteria) Then
MsgBox "This BOOK ID: " & [NewID] & ", Already exist taken in the Database, " _
& vbCr & vbCr & "Please Check enter the correct BOOK ID", vbInformation, "HELLO USER.... DUPLICATE INFORMATION"
Me.Undo
'undo the process and clear all fields
Me.SetFocus
End If
End Sub
Please help me