Suppressing Error Messages

  • Thread starter Thread starter Ian Belcher
  • Start date Start date
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
 
You could use one of the following:

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

or

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


hth,
 
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





.
 
Back
Top