Dear All
I have created form to add record.
In he first textbox I have created a lost focus as given below:
Dim db
Dim rs1
Set db = CurrentDb
Set rs1 = db.OpenRecordset("NEWITEM", 2)
rs1.FindFirst "bcode=" & " ' " & Text0 & " ' "
If rs1.NoMatch Then
MsgBox "THIS IS A NEW ITEM CODE", vbInformation
Else
Text0 = rs1(0)
Text2 = rs1(1)
Text4 = rs1(2)
Text6 = rs1(3)
Text8 = rs1(4)
Text10 = rs1(5)
Text12 = rs1(6)
Text14 = rs1(7)
Text16 = rs1(8)
MsgBox "THE ITEM CODE ALREADY EXISTS", vbCritical
End if
But it always gives the msg - THIS IS A NEW ITEM CODE
Please help