Create Table queries in Access 2000 - stopping the confirm dialog box

D

David Gartrell

Hi there,

Hopefully someone out there may be able to help me out.

Basically I have some VB code which creates a table but sometimes, for
various valid reasaons, the table already exists and Access comes up with a
dialog box telling me that the existing table must first be deleted and
asking me if its ok to do this before the new one can be created. Here is
what the dialog box says:

"The existing table 'Table1' will be deleted before you run the query. Do
you want to continue anyway? - with YES & NO buttons

Does anyone know of a way of stopping Access from displaying this dialog box
as, ideally I'd like the whole thing to run automatically regardless of
whether the table already exists or not. Hope someone can help.

Many Thanks.

David
 
G

Guest

You can turn off MS Access warnings prior to running Action queries:
DoCmd.SetWarnings False
 
J

John Vinson

Hi there,

Hopefully someone out there may be able to help me out.

Basically I have some VB code which creates a table but sometimes, for
various valid reasaons, the table already exists and Access comes up with a
dialog box telling me that the existing table must first be deleted and
asking me if its ok to do this before the new one can be created. Here is
what the dialog box says:

"The existing table 'Table1' will be deleted before you run the query. Do
you want to continue anyway? - with YES & NO buttons

Does anyone know of a way of stopping Access from displaying this dialog box
as, ideally I'd like the whole thing to run automatically regardless of
whether the table already exists or not. Hope someone can help.

Many Thanks.

David

I'd suggest simply deleting the table prior to running the MakeTable.
Trap and ignore the error message you'll get if the table doesn't
exist.

Why the MakeTable query? In my experience they are rarely truly
necessary, since you can base a Form, Report, export, or even another
query on a Select query...

John W. Vinson[MVP]
 

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