Run time error 3211

S

Stapes

Hi

Something that was working fine has suddenly started chucking out this
error message: -

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

This is rubbish, as I am the only person working on it.

This is the place where it is failing: -

STRSQL = "SELECT FM_InvoiceImport.Field3, '0' AS Expr1 INTO
TM_InvoiceItemGroup " & _
"FROM FM_InvoiceImport " & _
"GROUP BY FM_InvoiceImport.Field3, '0';"
DoCmd.RunSQL STRSQL

I have tried rebooting my PC. It made no difference.

Any ideas?

Stapes
 
D

Douglas J. Steele

You actually might be the other person...

What else is open in your application when your code runs? Do you have a
form open that's based on TM_InvoiceItemGroup?
 
S

Stapes

Hi

Yes, you are dead right. The current form has a subform based on
TM_InvoiceItemGroup. But it isn't populated until it has processed it
in that bit of code. I wonder why this has suddenly occured in a
system that had previously been running fine. I had been putting
Option Explicit statements in all the modules. Could that have
anything to do with it?

Stapes
 
S

Stapes

Hi

Yes, you are dead right. The current form has a subform based on
TM_InvoiceItemGroup. But it isn't populated until it has processed it
in that bit of code. I wonder why this has suddenly occured in a
system that had previously been running fine. I had been putting
Option Explicit statements in all the modules. Could that have
anything to do with it?

Stapes

Further to that - this is the bit of code that comes next, referencing
the subform: -

[LKQRY_AllAccountNumbersNotFoundOnImport subform].SourceObject =
"LKQRY_AllAccountNumbersNotFoundOnImport_subform"

Stapes
 
S

Stapes

Hi

Yes, you are dead right. The current form has a subform based on
TM_InvoiceItemGroup. But it isn't populated until it has processed it
in that bit of code. I wonder why this has suddenly occured in a
system that had previously been running fine. I had been putting
Option Explicit statements in all the modules. Could that have
anything to do with it?

Stapes

Hi

I found the error. By comparing my current version with the previous
release. I had added a button to allow the user to go off and do
something else & return. On return from that process, the data source
for the subform is already set. Can I unset it?Previously, they were
having to close the form, do this other process, then return to it. I
was trying to speed the work flow for them.

Stapes
 
D

Douglas J. Steele

Stapes said:
Hi

I found the error. By comparing my current version with the previous
release. I had added a button to allow the user to go off and do
something else & return. On return from that process, the data source
for the subform is already set. Can I unset it?Previously, they were
having to close the form, do this other process, then return to it. I
was trying to speed the work flow for them.

You should be able to set the RecordSource to a zero-length string, and then
set it back once you need to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top