Did not have this error yesterday - Run-time error '3219" Invalid operation

I am developing an Access database in 2007 with a FE/BE configuration. I implemented a number of UI changes yesterday that worked just fine.... yesterday...

Today, in testing the very same UI I am receiving "Run-time error '3219" Invalid operation" on more than one line of code, and UIs that I did not touch yesterday. The line (>>>) below is one example, which I DID NOT CHANGE TODAY.

Thanks in advance.

Private Sub cmdAssignNo_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset, rst1 As DAO.Recordset
 
        Set db = CurrentDb()
        Set rst = db.OpenRecordset("assign Plan No", dbOpenTable)
>>>        Set rst1 = db.OpenRecordset("tblPlan", dbOpenTable, dbPessimistic)

Open in new window

Destiny947Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Patrick MatthewsCommented:
Hello Destiny947,

Check your references in the VB Editor, and see if any are listed as missing.

Regards,

Patrick
0
Rey Obrero (Capricorn1)Commented:
this line does not have the correct argument

Set rst1 = db.OpenRecordset("tblPlan", dbOpenTable, dbPessimistic)

         

                 OpenRecordset (source, type, options, lockedits)

dbPessimistic is one of the lockedits not options

change

Set rst1 = db.OpenRecordset("tblPlan", dbOpenTable, dbPessimistic)

to

Set rst1 = db.OpenRecordset("tblPlan", dbOpenTable,, dbPessimistic)
0
Destiny947Author Commented:
Hi Matthew and Capricorn1.

Matthew: I will check for any missing VBE references.

Capricorn1: I will make the change to my "set rst" statement.

Will be back shortly...

Thanks for your fast responses.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Destiny947Author Commented:
Hi,

No missing references, and even with the corrected syntax, I still get the same error message.

???
0
Rey Obrero (Capricorn1)Commented:
try this, see if you still get the error

Set rst1 = db.OpenRecordset("tblPlan")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Destiny947Author Commented:
Okay...
be right back...
0
Destiny947Author Commented:
Hi Cap,

The error did not occur with that change.

What does this suggest?
0
Destiny947Author Commented:
This event requires that only one person is accessing the table at a time to  find the max number and then assign the next sequence.
0
Destiny947Author Commented:
I'll ask another question to address how the code should be written so that this table is locked.

This 1 step forward, 2 steps back is so frustrating...

Thank you...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.