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

  • Thread starter Thread starter David Gartrell
  • Start date Start date
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
 
You can turn off MS Access warnings prior to running Action queries:
DoCmd.SetWarnings False
 
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]
 
Back
Top