S. S. Rawat
S. S. Rawat

Reputation: 6111

How to get data from linked table?

I'm new in VBA so i don't know how to get data from linked table in ms access, But i tried some code but it show this error

"Run time error '3219' 
Invalid Operation

I already search this error everywhere but not find right answer.

Code

 Dim db As DAO.Database
 Dim db As DAO.Recordset
 Set db = CurrentDb

 Set rsHoliday = db.OpenRecordset("Holidays", dbOpenTable)
//Error Occur in this line

Upvotes: 0

Views: 432

Answers (1)

PaulFrancis
PaulFrancis

Reputation: 5809

You are trying to assign a Table to a Recordset. Loose the dbOpenTable parameter from the code. It would compile just fine and do what you want. Unless you wish to open the table you need to use DoCmd.OpenTable

Upvotes: 1

Related Questions