Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264

    Unhappy Unanswered: Form remains locked

    I am having a problem with a form that I open through code. The form is bound to a table that keeps track of the users progress. I have a button on my main form to open this form and display the data for the current month (the month selected on the main form). The first time I click this button it works fine. This display form is then closed (the form is modal, so they are forced to close it before continuing) and the main form is still active.

    Problem is, when the button is pressed a second time there is a warning that the underlying table is locked and cannot be opened. I get a choice of debug or end. If I click end and try to open the form again it works fine and will continue to work fine for several instances of opening and closing.

    Any thoughts?

    Steve

  2. #2
    Join Date
    Jul 2004
    Posts
    125
    Reduce your time settings in Options, under the Advanced tab. The table is timed to release the bound form. Also, try to requery the form before closing.

  3. #3
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    Thanks for the reply but that did not solve the problem. I now requery the form before it is closed and I set all of the intervals down to 1 second. I still get the same result as before. I also tried letting it sit for almost 10 minutes before clicking the button a second time, that didn't help either.

    It always goes in this pattern.
    1. Open Form
    2. Close form
    3. Try to open again and get error
    4. Click on end (in error)
    5. Try to open form again - works fine.
    6. close form
    7. repeat steps 5 & 6 as many times as you want - no errors.

    Any other thoughts?

    Steve

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    What is the setting for the database for record locking?

    Look in: Tools->Options->Advanced(Tab)->Default record locking

    Set it to "Edited Record" if not already set ...

    Also, how is the table bound to the form? Is it a temporary table?
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    Thanks. Setting the "Edited Record" option for the database did not change the behavior but setting the property for the form fixed the problem.

    Steve

Posting Permissions

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