Listbox FindFirst (1 Viewer)

BartekSollie

New member
Local time
Today, 21:12
Joined
May 1, 2006
Messages
4
When, id do press the 'RecordWeergeven' button, Microsoft Visual Basic returns with a error. Method or data member not found. I think the error is located bij Me.Keuzelijst0. Do i have to declare a Listbox or create a second recordset. Please help.

Private Sub RecordWeergeven_Click()
'Me.RecordsetClone.Findfirst "[ID] = " & Me.lstList.ItemData(lstList.ListIndex)
'Me.Bookmark = Me.RecordsetClone.Bookmark
Dim rst As ADODB.Recordset
Set rst = Forms![FMR_users].RecordsetClone
rst.FindFirst "usr_id=" & Me.Keuzelijst0 & ""
Forms![FMR_users].Bookmark = rst.Bookmark
DoCmd.Close acForm, "GaNaarRecord"
End Sub
 

woknick

Registered User.
Local time
Today, 12:12
Joined
Sep 25, 2004
Messages
85
Dim rst As object
 

boblarson

Smeghead
Local time
Today, 12:12
Joined
Jan 12, 2001
Messages
32,059
If you declare rst as an ADODB Recordset, you have to open the recordset using the ADO syntax
Code:
Set rst = New ADODB.Recordset
rst.Open "TableOrQueryNameHere", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
I don't know if you can assign a recordsetclone to the ADO recordset, but you could try. Also, the adOpenDynamic can be replaced by 3 other options and adLockOptimistic has another 3 options instead of that one too.
 

Users who are viewing this thread

Top Bottom