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. :)
|