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.
 
Back
Top