-
Dim WithEvents adoBedRS As Recordset
Private Sub Form_Load()
Dim SQL As String
Set adoBedRS = New Recordset
adoBedRS.Open "select BEDname,BEDSIZE from BED", Conn1, dbOpenDynaset, adLockOptimistic
adoBedRS.findfirst "bed=1" ' this won't work why ??
End Sub
-
how do i do to move the cursor to the record i've just found ??
-
You are using ADO, and ADO does not have a .FindFirst
method. To find the first record that matches the criteria,
move to the first record and then execute the .Find method,
like this:
Code:
adoBedRS.MoveFirst
adoBedRS.Find "bed = 1"
If adoBedRS.EOF Then
MsgBox "Record Not Found"
Else
MsgBox "Record Found"
End If
For your second question, when you find a record, the cursor
is already pointing to it.