Hi Ted,
Tabletype recordsets can not be used on linked tables. Add to that the fact
that Index and Seek are only available with table-type Recordset objects.
There are two options - you can either open the backend
database directly, then open a table-type recordset and use the Index
property and seek method or open a recordset on the linked table and use one
of the Find methods (FindFirst, FindLast, FindNext, FindPrevious).
To open a tabletype recordset on the backend database use the Opendatabase
method to get a reference directly to the back end database (instead of
using currentdb()). Then open the recordset using the reference to the
backend database. Then, be sure to close the db - something you wouldn't
normally do with a db object that was created from currentdb().
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = OpenDatabase("C:/mydata/mydb.mdb")
Set rst = db.OpenRecordset("tblMyTable", dbOpenTable)
With rst
' do what you need to do here
.Close
End With
db.Close
Set rst = Nothing
Set db = Nothing
--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.
ted said:
Started switching to the split db & have a problem with vba code:
1. openrecordset( ... , table ) no longer works with linked tables
2. Keys no longer work like: rstMember.Index = "sheet1mem#" or
rstMember.Index = "primarykey"
So whats the solution? TIA