Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004
    Posts
    7

    Unhappy Unanswered: Report locks table even when closed

    Hi,

    I have posted this question in another forum but had no response so here's hoping you guys can help me.

    Basically, I'm running MS Access 2000 and have some VB code which happily generates a report from a form (it creates a table via SQL, then opens a report which uses that table as its control source). After I have printed off the report I want to generate a new one, so I change the underlying data via the form, then run the report again. Only it doesnt work second time round.

    I always get the same error:

    Run Time Error 3211

    The database engine could not lock table 'MYTABLE' because it is already in use by another person or process.

    It doesnt seem like the report stops using the table and therefore I cant change it without exiting Access completely first.

    This is very frustrating. Is there some VB code that can be used to get the report to unlock the table as soon as it is closed?

    Thanks!

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Is the report still active?
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Dec 2004
    Posts
    7
    no. but i've found out the problem:

    I had to comment out some code which I no longer needed but was still being run in the form.

    'Dim cnn As ADODB.Connection
    'Dim rst1 As New ADODB.Recordset
    'Set cnn = CurrentProject.Connection

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    That would do it ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •