This is the main code showing that every time I search data type mismatch in criteria expression and method refresh of object IADODC failed this was showing
Private Sub gosearch_Click()
adogrid.RecordSource = "Select *from StudentsInformation where IDNo='" + Text1.Text + "' or Name='" + Text1.Text + "'"
adogrid.Refresh
If adogrid.Recordset.EOF Then
MsgBox "Record Not Found, Enter any other IDNo or Name", vbCritical, "Message"
Else
adogrid.Caption = adogrid.RecordSource
End If
End Sub