Results 1 to 4 of 4
  1. #1
    hockeyman9474 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Location
    Manalapan, NJ
    Posts
    45

    Run-Time 3211 Error After OutputTo

    I have a report who's datasource is a table called MASTER.
    I have form with a combobox with an on change action that drives a set of queries that are filtered by what is selected in the combo box
    The final step in the process is to drop the current MASTER table, make a new MASTER TABLE, and set a primary key:
    CurrentDb.TableDefs.Delete "Master"
    DoCmd.OpenQuery "MASTER_MT"
    DoCmd.RunSQL "CREATE INDEX ind ON [MASTER] ([DC]) With Primary"

    everything worked well until I created a save button on the report with the following code:



    DoCmd.OutputTo acOutputReport, "SalesCompare", acFormatPDF, "\\sdc-files\Sales Comparison\Reports" & FileName, 1

    that works perfectly, however, after closing the form, and making another selection from the combo box, Run-Time 3211 error is generated at the point of dropping the MASTER table citing that it is locked and cannot be dropped. How is it locked if it was only accessed as a data source by a report that is already closed.

    I have create a refresh button that clears the combo box and reloads the form. I have attempted to close the only recordset I have, even though it is not used to open the form or output the form or close the form. Remember this error began after adding the output command, and it appears as if the report is closed, but it's connection to the data source remains.

    Any Ideas

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Why do you need to create a new table, not delete all and append?

  3. #3
    hockeyman9474 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Location
    Manalapan, NJ
    Posts
    45

    Agreed

    that's why I solved the thread. I reviewed my work and thought mmmmmm. That new work around still got me the same results without the error

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Got it first time! Sometimes a nudge is all we need.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 11-13-2016, 07:12 PM
  2. Replies: 6
    Last Post: 10-21-2014, 12:25 PM
  3. Error 3211 - table in use by another
    By D'Anconia in forum Forms
    Replies: 4
    Last Post: 05-19-2014, 05:28 PM
  4. Error 3211
    By Phred in forum Programming
    Replies: 1
    Last Post: 01-25-2012, 10:29 PM
  5. Error 3211 Object cannot be locked
    By TheShabz in forum Forms
    Replies: 9
    Last Post: 08-23-2011, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums