Object doesn't support this property or method

Howlsta

Vampire Slayer
Local time
Today, 14:59
Joined
Jul 18, 2001
Messages
180
I get this msg when i try to run the code below:

Object doesn't support this property or method

The error is caused by the following line.
I got it straight from a book so it should work. It doesn't seem to like me using Find:
Me.Recordset.Find "LastName = " & strName, Start:=1



Private Sub cmdFind_Click()

Dim strName As String
Dim varBookmark As Variant
varBookmark = Me.Recordset.Bookmark
strName = InputBox("Enter Surname")

Me.Recordset.Find "LastName = " & strName, Start:=1
If Me.Recordset.EOF Then
MsgBox "Surname " & strName & " Not Found!!"
Me.Recordset.Bookmark = varBookmark
End If
End Sub
 
Are you using recordsets in the rest of your code?

P.S. Code straight from a book, any book, rarely works without some tinkering *sigh*
 
I can't be arsed with this any more, there's simpler ways of finding records so it's not that important. Thanks anyway. I tried using recordsets in the load event too, but that was pissing me off too.

Rich
 

Users who are viewing this thread

Back
Top Bottom