Sub FindPosition()
Dim strSQL As String
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.Open "Select * from Products"
strSQL = "[ProductID] = " & 1
rst.Find strSQL
'If record is found, print its position
If rst.EOF Then
msgBox lngValue & " Not Found"
Else
Debug.Print rst.AbsolutePosition
End If
rst.Close
Set rst = Nothing
End Sub
|