0

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

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

To add to this, dbOpenDynaset will allow for editable records and dbOpenSnapshot is a "read-only" snapshot of the data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.