Access 2019 Runtime error 3219 invalid operation RRS feed

  • Question

  • I have a db with front_end for code and back_end for data. 

    when I use DoCmd.OutputTo  to output a query to Excel I get run-time error 3219: Invalid Operation

    this code used to work 2 years ago access 2016. Now I use access 2019 and perhaps it's the cause of this error.

    How to Fix it? 

    Friday, December 18, 2020 5:51 AM

All replies

  • Please post your code for us to review.

    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Friday, December 18, 2020 11:21 AM
  • to trouble shoot, perform that export manually using the tools in the ribbon.... verify if that works ok
    Friday, December 18, 2020 1:19 PM
  • Ditto. Tried it and got the same error 

    Friday, December 18, 2020 10:46 PM
  • hmm well let's break things down... your original post uses the term 'runtime'...  but in order to to a manual export via the ribbon one must have full license, not runtime license... so you do have a full license - yes?

    ... and you say you are exporting a query

    you run the query out of the navigation pane and it runs ok giving you the results data set?

    ... and you have the full 2019 Office license ... so that excel opens fine and is useable...

    ...this is all happening on 1 PC ?.. the Access and excel all on the same PC

    Friday, December 18, 2020 10:53 PM
  • Hi thanks for replying. The error is with the query. It runs almost to the end (as shown in the status bar) anf then crashes. 

    Difficult to know why - there are many similar queries that run successfully for several years ... 

    So I'm trying to create a wysiwig type of export. That is the data on the list form should be in the query. 

    To that effect I created a query from controls on the form and save it as a query in querydefs with sort and filter so we get the data that's on the form. And then OutputTo.

    at first I thought the Output to if causing the error. But no, it's the query. 

    However when I open the query and delete just 1 Field - it runs fin. completely baffled. 



    • Edited by ADG144 Tuesday, December 22, 2020 3:20 AM
    Monday, December 21, 2020 10:55 PM
  • As already requested, please post the query SQL and, if relevant, any associated code so  we are able to advise you Also, how many records should be exported and which version of Excel are you using? xls or xlsx format?
    • Edited by isladogs52 Tuesday, December 22, 2020 12:31 AM
    Tuesday, December 22, 2020 12:29 AM
  • so you have a query, in the navigation pane... and when you run it there is this crash....but if you delete "just 1 field" it runs ok...

    so that kind of begs the question as to whether it is a specific field or is it any field that must be deleted to run ok...?

    you mention that the query has a 'filter' ... and by that I believe you mean there is criteria in the WHERE clause...since your original post is that was running for years, and has broken seemingly as part of an upgrade then not knowing what this criteria is; it is maybe a candidate for the problem and you should test it without it or with perhaps a variant of it ideally that is more simple....

    queries pretty much run flawlessly and so an invalid operation error should be something that we could find the cause of .....

    off the cuff - if it is not too burdensome - just make a brand new query from scratch - - and step by step run it...as you add tables/joins/fields...and perhaps you'll find the culprit....

    Tuesday, December 22, 2020 1:49 PM