hye
here is my code but it is not working plz help me.

FRd = txtBCode.Text
On Error Resume Next
Set Mydb = OpenDatabase("E:\Projects\TS\database\MyDb.mdb")
Set Myrs = Mydb.OpenRecordset("SELECT * FROM ItemEntry  Where[Barcode]= "&FRd, dbOpenDynaset)
' other data have to retrive.
If Not Myrs.EOF = True Then
txtINameS.Text = Myrs("ItemNameSize").Value
'txtPrice.Text = Myrs("ItemPrice").Value
Else
MsgBox "No Record Foun.Try again"
Exit Sub

Try this 4 lines of code instead of line nos. of your codes 7 to 11

txtINameS.Text = Myrs("ItemNameSize").Value
If Myrs.RecordCount = 0 then
MsgBox "No Record Foun.Try again"
Endif
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.