بسم الله الرحمن الرحيم
اخواني انا عندما أبحث بيانات في قاعدة بيانات تظهر هذه الرسالة :
مع العلم اني وضعت حقل ID نوع ترقيم تلقائي
وهذا هو الكود :
Y = InputBox("Enter Code" & Chr(10) & " search")
sql = "select * from products where ID_product = '" & Trim(Y) & "'"
rs.Open sql, db, 1, 2
''''''''''IF NOT Found''''''''''''''
If rs.EOF = True Then
MsgBox "not found", vbOKOnly + vbInformation + vbMsgBoxRtlReading, "search"
Me.OsenXPButton4.Enabled = False
Me.OsenXPButton5.Enabled = False
Exit Sub
Else
With MSFlexGrid1
.TextMatrix(0, 0) = "ID"
.TextMatrix(0, 1) = "name"
.TextMatrix(0, 2) = "unit price"
.TextMatrix(0, 3) = "amount"
.TextMatrix(0, 4) = "Total"
.TextMatrix(0, 5) = "date"
.TextMatrix(0, 6) = "name of supplier"
.TextMatrix(0, 7) = "address of supplier"
End With
MSFlexGrid1.Rows = rs.RecordCount + 1
MSFlexGrid1.TextMatrix(1, 0) = rs![ID_product]
MSFlexGrid1.TextMatrix(1, 1) = rs![Name]
MSFlexGrid1.TextMatrix(1, 2) = rs![price_unite]
MSFlexGrid1.TextMatrix(1, 3) = rs![amount]
MSFlexGrid1.TextMatrix(1, 4) = rs![total_prices]
MSFlexGrid1.TextMatrix(1, 5) = rs![receiving_date]
MSFlexGrid1.TextMatrix(1, 6) = rs![name_supplier]
MSFlexGrid1.TextMatrix(1, 7) = rs![notes_supplier]
Me.OsenXPButton4.Enabled = True
Me.OsenXPButton5.Enabled = True
End Ifاريد في هذا الكود البحث بكود المنتج فما سبب هذا الخطا؟؟؟
