HI EVERYONE CAN SOMMEONE HELP ME PLEASE I'M STRUGGLING WITH THIS CODE TO SEARCH THROUGH MY DATABASE IN ACCESS BUT WHEN I TRY TO RUN IT DISPLAY A MESSAGE "OBJECT REQUIRED " WHAT CAN I DO?
Private Sub cmdSearch_Click()
Dim Searchit As String, Founder As Boolean
Searchit = UCase(InputBox("Enter Item code:"))
If Len(Searchit) > 0 Then
Adodc1.Recordset.MoveFirst
Founded = False
End If
Do While (Not Founder) And (Not Adodc1.Recordset.EOF)
If UCase(Adodc1.Recordset.Fields("ITEM_CODE")).Value = Searchit Then
Founder = True
Else
Adodc1.Recordset.MoveNext
End If
Loop
If Not Founder Then
MsgBox "Unable to find the required item", , "Not Found"
Adodc1.Recordset.MoveLast
Else
MsgBox "Must enter an item code", , ""
End If