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

Posted on 2008-11-17
Medium Priority
1 Endorsement
Last Modified: 2013-11-27
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

Question by:Destiny947
  • 6
  • 2
LVL 93

Expert Comment

by:Patrick Matthews
ID: 22977916
Hello Destiny947,

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


LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22977968
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


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


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

Author Comment

ID: 22978087
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.
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.


Author Comment

ID: 22978119

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

LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 22978140
try this, see if you still get the error

Set rst1 = db.OpenRecordset("tblPlan")

Author Comment

ID: 22978154
be right back...

Author Comment

ID: 22978164
Hi Cap,

The error did not occur with that change.

What does this suggest?

Author Comment

ID: 22978206
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.

Author Comment

ID: 22978351
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...

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question