Run-Time Errror 3211: "The db engine could not lock..."

T

Tom

Hi,

I need some help with bypassing/ignoring run-time error 3211.

Background Info (what I have in db):

frmLogin:
- when opened, it will execute a MakeTable query (tblIndexScoreAll)
- click on link "Balanced Scorecard"... this opens frmBalancedScoreCard

frmBalancedScoreCard:
1. I open frmBalancedScoreCard which has a bunch on unbound textboxes
(colored boxes).
2. When I click on any of the textboxes, some criteria will be extracted
from its control name. These will be passed into the form's
"CurrentDb.QueryDefs("qry06GetBSC_DetailData").SQL = "SELECT....". Then,
the SELECT query is created.

Queries:
1. Based on the in frmLogin created table "tblIndexScoreAll", multiple
"helper queries" will generate additional information
2. One of the queries is linked to a report.

Now, here's the process that generates the error:
1. I have drilled down to "frmBalancedScoreCard"
2. I click on any of the unbound textboxes
3. Report is automatically opened and shows proper information.... thus far,
everything works great.
4. Now, however, if I were to close the application (with the report still
being open), I get the RunTime Error 3211. It indicates the following:
"The db engine could not lock table tblIndexScoreAll because it is already
in use by another person." The report has a "helper table" as its record
source... and that query is linked to tblIndexScoreAll.
5. When I click Debug, dozens of VBA windows keep popping up (for split
seconds) ... but then the application closes.

So, I am not sure where I would have to put an error catching clause... or
maybe there are some properties I should set. Essentially, it's perfectly
fine that someone can close the application without closing the report
first.

Any suggestions,
Tom
 
Top