Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Access

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 04-25-2007, 09:38 PM
Novice
 
Join Date: Apr 2007
Location: port macquarie
Posts: 1
bob646
Default Delete all records in a table?

I want to place code in a click event to delete all records in a table but keep the table for new records. DELETE * FROM Employees WHERE Title = 'Trainee'; seems to have trouble with the asterisk.
Reply With Quote
  #2  
Old 05-20-2007, 09:41 PM
Novice
 
Join Date: May 2007
Posts: 1
gary84
Default

Dim db As dao.Database
Set db = CurrentDb()
db.Execute "Delete * From [" & TableName & "]"
Set db = Nothing
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro to delete all rows from a table on close Jallen17 Access 0 08-25-2008 10:17 AM
Inserting multiple records into a table New2Access Programming 0 02-18-2007 09:46 PM
Creating a string from all records in a table ocordero Programming 2 08-07-2006 07:21 AM
Selecting and modifying records in a table Ed H Access 1 03-17-2006 09:04 AM
Delete query, deleting customers froma table. keithsrobinson Queries 2 02-14-2006 08:33 AM


All times are GMT -8. The time now is 02:57 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.