Option Compare Database
Option Explicit
Private Sub cmdRecordset_Click()
Dim dbs As DAO.Database
Dim rsTable As DAO.Recordset
Dim dblPhone As Double
Set dbs = CurrentDb
Set rsTable = dbs.OpenRecordset("tblProspect", dbOpenTable)
dblPhone = 4134980210#
rsTable.Index = "PrimaryKey"
rsTable.Seek "=", dblPhone
If rsTable.NoMatch = True Then
MsgBox "Did not find"
Else
Me.Filter = "[hPhone] = " & rsTable!hPhone
Me.FilterOn = True
End If
Set rsTable = Nothing
End Sub
|