Openrecordset error

M

Max

Access 2000, SP3: I get an error #3219 "Invalid Operation" on this line of
code:
Set Var = CurrentDb().OpenRecordset("MyTable", dbOpenTable)
where Var has been Dimmed as Recordset and MyTable is a linked table.
The following references are set in this order:
VBA
MS Access 9.0 Obj Libr
OLE Automation
MS DAO 3.6 Obj Libr
MS ActiveX Data Objs 2.1 Libr
What am I doing wrong?
Thanks in advance for your help.
 
G

George Nicholson

From the 2002 Help entry for the OpenRecordset method (Remarks, 1st
paragraph):

"...if source refers to an SQL statement or a TableDef that represents a
linked table, you can't use dbOpenTable for the type argument; if you do, a
run-time error occurs."

HTH,
 
M

Max

Thanks for the answer. It worked just fine in Access 2000. What is the
correct constant to use for a linked table?
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top