Error in code

wilko

Registered User.
Local time
Yesterday, 20:35
Joined
Feb 16, 2006
Messages
20
Hi guys,

Ive been trying to add search form to my database, and used an example provided in these forums.

Private Sub List2_DblClick(Cancel As Integer)
Dim rs As Object

DoCmd.OpenForm "TopicSearch"

Set rs = Forms!TopicSearch.Recordset.Clone (Error line)
rs.FindFirst "[TopicID] = " & Str(Nz(Me![List2], 0))
If Not rs.EOF Then Forms!TopicSearch.Bookmark = rs.Bookmark

DoCmd.Close acForm, Me.Name

End Sub

Private Sub TxtSearch_Change()
Dim vSearchString As String

vSearchString = Me.TxtSearch.Text
Me.txtSearch2.Value = vSearchString
Me.List2.Requery

End Sub

I am not too upto scratching with programming so maybe I have missed something simple. Basically I took the code provided in the example database and changed the relevant form names, text box names etc. Incidently the error that appears is

"object variable or with block vairable not set"

Any help would be much appreciated,

Ross
 
Try making it one word: RecordsetClone
and declare rs as a Recordset instead of an object
 
modest said:
Try making it one word: RecordsetClone
and declare rs as a Recordset instead of an object

Thanks for that, I realised what the problem was, i was pointing to the wrong form :-)
 

Users who are viewing this thread

Back
Top Bottom