Error 3211- The database engine could not lock table

  • Thread starter Thread starter diegov
  • Start date Start date
D

diegov

Hi,

I have 2 combo boxes. My aim is to fill the 2nd combo dinamically, by the
choice on the 1st combo.
With the event onchange of the 1st combo I create a table with docmd.runsql
"select...-into...mytable". The 2nd combo rowsource is a query on mytable.
Matre of the fact is that the 1st time I use it everything works fine but...
after anothe choice I get the error "Error 3211- The database engine could
not lock table"

Any Idea?

Thanks in advance
 
Hi,

I have 2 combo boxes. My aim is to fill the 2nd combo dinamically, by the
choice on the 1st combo.
With the event onchange of the 1st combo I create a table with docmd.runsql
"select...-into...mytable". The 2nd combo rowsource is a query on mytable.
Matre of the fact is that the 1st time I use it everything works fine but...
after anothe choice I get the error "Error 3211- The database engine could
not lock table"

Any Idea?

Thanks in advance

Creating a *BRAND NEW TABLE* every time you change the first combo - or even
filling an existing table - is a horribly inefficient and bloat-prone way to
do this.

Instead, simply base the second combo on a Query selecting records from its
table, using the first combo as a query criterion:

=[Forms]![YourFormName]![FirstComboName]

as a criterion. Requery the second combo in the afterupdate event of the
first.
 
gjgj
John W. Vinson said:
Hi,

I have 2 combo boxes. My aim is to fill the 2nd combo dinamically, by the
choice on the 1st combo.
With the event onchange of the 1st combo I create a table with
docmd.runsql
"select...-into...mytable". The 2nd combo rowsource is a query on mytable.
Matre of the fact is that the 1st time I use it everything works fine
but...
after anothe choice I get the error "Error 3211- The database engine could
not lock table"

Any Idea?

Thanks in advance

Creating a *BRAND NEW TABLE* every time you change the first combo - or
even
filling an existing table - is a horribly inefficient and bloat-prone way
to
do this.

Instead, simply base the second combo on a Query selecting records from
its
table, using the first combo as a query criterion:

=[Forms]![YourFormName]![FirstComboName]

as a criterion. Requery the second combo in the afterupdate event of the
first.
 
I got it. Thanks to you John!

Diego

John W. Vinson said:
Hi,

I have 2 combo boxes. My aim is to fill the 2nd combo dinamically, by the
choice on the 1st combo.
With the event onchange of the 1st combo I create a table with
docmd.runsql
"select...-into...mytable". The 2nd combo rowsource is a query on mytable.
Matre of the fact is that the 1st time I use it everything works fine
but...
after anothe choice I get the error "Error 3211- The database engine could
not lock table"

Any Idea?

Thanks in advance

Creating a *BRAND NEW TABLE* every time you change the first combo - or
even
filling an existing table - is a horribly inefficient and bloat-prone way
to
do this.

Instead, simply base the second combo on a Query selecting records from
its
table, using the first combo as a query criterion:

=[Forms]![YourFormName]![FirstComboName]

as a criterion. Requery the second combo in the afterupdate event of the
first.
 
diegov said:
Hi,

I have 2 combo boxes. My aim is to fill the 2nd combo dinamically, by the
choice on the 1st combo.
With the event onchange of the 1st combo I create a table with
docmd.runsql "select...-into...mytable". The 2nd combo rowsource is a
query on mytable. Matre of the fact is that the 1st time I use it
everything works fine but... after anothe choice I get the error "Error
3211- The database engine could not lock table"

Any Idea?

Thanks in advance
 
Glad to help. Do run Tools... Database Utilities... Compact and Repair to
recover the space from your previous attempts, if you haven't already done so!
I got it. Thanks to you John!

Diego

John W. Vinson said:
Hi,

I have 2 combo boxes. My aim is to fill the 2nd combo dinamically, by the
choice on the 1st combo.
With the event onchange of the 1st combo I create a table with
docmd.runsql
"select...-into...mytable". The 2nd combo rowsource is a query on mytable.
Matre of the fact is that the 1st time I use it everything works fine
but...
after anothe choice I get the error "Error 3211- The database engine could
not lock table"

Any Idea?

Thanks in advance

Creating a *BRAND NEW TABLE* every time you change the first combo - or
even
filling an existing table - is a horribly inefficient and bloat-prone way
to
do this.

Instead, simply base the second combo on a Query selecting records from
its
table, using the first combo as a query criterion:

=[Forms]![YourFormName]![FirstComboName]

as a criterion. Requery the second combo in the afterupdate event of the
first.
 

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

Similar Threads

Run time error 3211 5
Database Synchronization error 2
Table is locked by another person or process?? 2
Error 3211 2
combo box data type 1
Combo box trouble 1
error 3211 1
ComboBox 2

Back
Top