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 / Database Design / January 2004

Tip: Looking for answers? Try searching our database.

Quick way to emply tables from VBA ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 23 Jan 2004 15:36 GMT
What is the best way to empty several tables in VBA. I'm writing a conversion routine and need to do this when I do a rerun.
Allen Browne - 23 Jan 2004 15:42 GMT
Supply your table names to this kind of routine:

Dim strTable As String
Dim db As DAO.Database

strTable = "[MyTable]"
dbEngine(0)(0).Execute "DELETE FROM " & strTable & ";", dbFailOnError

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> What is the best way to empty several tables in VBA. I'm writing a conversion routine and need to do this when I do a rerun.
 
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.