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





.
 

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