Docmd.RunSQL - suppress Yes/No

davesmith202

Employee of Access World
Local time
Today, 02:49
Joined
Jul 20, 2001
Messages
522
When I run the code below, it pops up a question to ask if I wish to delete the data. How do I set it up so that it automatically does it without this question?

Code:
DoCmd.RunSQL ("DELETE * FROM tblStage2ParsedData;")

Thanks,

Dave
 
3 ways to do this but I will tell you 2.
1)
Docmd.setwarnings false
docmd.Runsql "Delete .."
Docmd.setwarnings false

2)
Currentdb.Execute "Delete .."

good luck
 
Thank you!
 
the difference between the two is that

once you suppress errors, then the first method may fail, and you will not know

the second can be used to inform you in the case of errors, and is a better idea.
 

Users who are viewing this thread

Back
Top Bottom