You might do something like:
Code:
Private Sub Command1_Click()
With Adodc1.Recordset
.Find "[" & strTarget & "] = '" & Text1.Text & "'", , _
adSearchForward, adBookmarkFirst
If .EOF Then
MsgBox "Not found"
Else
MsgBox "Found at record " & CStr(.AbsolutePosition)
End If
End With
End Sub
... where strTarget is the field to search. If practical just hardcode it in the search expression. This will move the "current row" in the datagrid however.
Alternatively you might use:
Code:
Private Sub Command2_Click()
Dim rsCopy As ADODB.Recordset
Set rsCopy = Adodc1.Recordset.Clone(adLockReadOnly)
With rsCopy
.Find "[" & strTarget & "] = '" & Text1.Text & "'", , _
adSearchForward, adBookmarkFirst
If .EOF Then
MsgBox "Not found"
Else
MsgBox "Found at record " & CStr(.AbsolutePosition)
End If
.Close
End With
End Sub
Searching all fields would require you to loop through the Recordset for each field of the desired type until you hit a match.