View Single Post
  #4 (permalink)  
Old January 10th, 2007, 09:20 AM
wscheiman wscheiman is offline
Authorized User
 
Join Date: Oct 2003
Location: Cleveland, OH, USA.
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There's another way to do this using VBA code only (if you'd like):


Dim lngRowsAffected As Long

CurrentProject.Connection.Execute "DELETE * FROM CUSTOMERS", lngRowsAffected


This not only does not require you to create a query object, but you can also check to see how many rows were deleted. I use this type of processing for INSERTs, UPDATEs, etc in a lot of my code without any problems.

In either case, both the .OpenQuery suggestion from mmcdonal and the CurrentProject approaches should work equally well. :)