Hi all
I have written a database in access and used ADODB recordsets all the
way through. The only recordsets that are not ADODB are the listbox
navigation code automatically generated by access 2003 as follows :
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ClientID] = " & Str(Nz(Me![lstclient], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I have tried doing the above by putting the following code into an
ADODB
Function ADODB_Goto_Record(frm As Form, fieldname As String, val As
Variant)
Dim Clone_RST As ADODB.Recordset
Set Clone_RST = frm.RecordsetClone
With Clone_RST
If Not (.EOF And .BOF) Then
Do Until .EOF
'Records Found So Check for 'strCriteria'
.Find "[" & fieldname & "] = " & val
'When found Goto record
'Forms!FormName.Bookmark = .Bookmark
frm.Bookmark = .Bookmark
'Moves Record set to next one
'.MoveNext - not sure if i need this as i cant get in to
test it
Loop
Else
'No Records Found,
End If
.Close
End With
Set Clone_RST = Nothing
Now this gives a 'type mismatch' error at the recordset.clone line.
Now i understand that the form will try to insert a
DAO.recordeset.clone into Clone_Rst which is obviously the cause of
the error.
I have changed the record source of the form to an SQL statement but i
still cant clone the current form recordset in ADODB and i've spent
ages on this
Can anyone HELP????
Someone out there must have successfully upsized to an SQL backend
using list boxes to navigate with.
Thanks in advance