Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Run silent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
timdolezal@gmail.com - 20 Dec 2005 12:58 GMT
I want to be able to delete a table and not be prompted with any
questions.

Can someone help me?
timdolezal@gmail.com - 20 Dec 2005 13:39 GMT
Found my answer.

   DoCmd.SetWarnings False
Douglas J. Steele - 20 Dec 2005 15:10 GMT
Just make sure you issue

DoCmd.SetWarnings True

afterwards, to ensure you get legitimate popups!

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Found my answer.
>
>    DoCmd.SetWarnings False
Tim Ferguson - 20 Dec 2005 19:07 GMT
> Found my answer.
>
>     DoCmd.SetWarnings False

Here's a better one:

 daoSQL = "DROP TABLE MyOldTable"
 db.Execute daoSQL, dbFailOnError

It's better because you get a proper trappable error (if you don't have
permission to drop the table, or the table doesn't exist, and so on); and
because you can't forget to switch SetWarnings back on again.

By the way, if you are going to re-create the table again afterwards, it is
often easier and kinder to the mdb file to empty out the rows instead:

 daoSQL = "DELETE FROM MyOldTable WHERE TRUE"
 db.Execute daoSQL, dbFailOnError

All the best

Tim F
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.