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

Posted on 2008-11-17
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
    LVL 92

    Expert Comment

    by:Patrick Matthews
    Hello Destiny947,

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


    LVL 119

    Expert Comment

    by:Rey Obrero
    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

    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.

    Author Comment


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

    LVL 119

    Accepted Solution

    try this, see if you still get the error

    Set rst1 = db.OpenRecordset("tblPlan")

    Author Comment

    be right back...

    Author Comment

    Hi Cap,

    The error did not occur with that change.

    What does this suggest?

    Author Comment

    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

    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

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now