Suppressing Error Messages

I

Ian Belcher

I'm using the command

Docmd.RunSQL select....into...

to create a new table. If this table already exists I get
an error message telling me that I'm going to delete a
table. Is there any way of suppressing this error message
within the module?

Thanks
Ian Belcher
 
C

Cheryl Fischer

You could use one of the following:

CurrentDB.Execute "Select ... into...", dbFailOnError

or

DoCmd.SetWarnings False
Docmd.RunSQL select....into...
DoCmd.SetWarnings True


hth,
 
I

Ian Belcher

Thanks for this.
-----Original Message-----
You could use one of the following:

CurrentDB.Execute "Select ... into...", dbFailOnError

or

DoCmd.SetWarnings False
Docmd.RunSQL select....into...
DoCmd.SetWarnings True


hth,
--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX





.
 
Top