Results 1 to 2 of 2
  1. #1
    dmeehanjr is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    1

    Question close form code not releasing recordsource..

    i have a temp table that is recordsource for a form, and I want to set command button that rebuilds the temp table and re-opens form.

    When I close the form by code or Macro, get runtime 3211 error that says 'table in use, cannot be deleted'.

    When I close the form by x-ing out, then run the query - it runs fine.

    (also added a 10 second pause, in case form needed more time to close out and release locks)



    not sure how to get around this?

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    well assuming your code to close the form, does indeed precede the code that deletes the table object - then this should not be happening.

    if it also seems that your form takes an unusually long time to close in manual mode - then I would suspect that form and consider whipping up a replacement if it isn't too much work.

    but otherwise try to separate the two actions. remove the delete table code so that the action is only to close the form. Put the delete table code in front of the make new table - so it is deleting the table just before it makes a new table. that will probably work.

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

Similar Threads

  1. How to Close access form after no activity
    By russ0670 in forum Forms
    Replies: 1
    Last Post: 05-17-2010, 08:17 AM
  2. Close All but One Form
    By Bruce in forum Forms
    Replies: 4
    Last Post: 04-06-2010, 09:31 AM
  3. Replies: 2
    Last Post: 01-29-2010, 11:33 AM
  4. close form
    By taylorosso in forum Forms
    Replies: 5
    Last Post: 08-25-2009, 12:18 PM
  5. Changing A Report Recordsource from a form
    By warrenjburns in forum Reports
    Replies: 0
    Last Post: 04-09-2009, 05:38 AM

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