Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete records from table 1

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
I want to create a button to delete all records in the table "tbltextimport".
What is the code for the macro ?

thanks in advance
 
VBA code:
DoCmd.RunSQL "DELETE * FROM tbltextimport"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thx, That was what I needed !
 
Running the script I get a confirmation-box.
Is it possible to delete the records without the confirmation-box ?
 

'No warnings
Docmd.SetWarnings False
'Warnings are back
DoCmd.SetWarnings True
 
Have a look at DoCmd.SetWarnings.

DoCmd.SetWarnings False will turn them off.

I'd recommend only turning it off for specific operations, and the re-enabling it after the operation has been performed.

Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Too fast Jerry... [wink]

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 

You added some recommendation flavor there, resulting in extra time to taste. [cheers]
 
Haha [cheers]

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top