By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,631 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

Help with SQL DELETE query

P: 31
Hello,

Wondered if anyone could help me. I've got a VB macro in Access with the following line:

DoCmd.RunSQL "Delete LaaBlock.* FROM LaaBlock", 0

I always get a dialogue box asking if I'm sure I want to delete XX rows from the table. Is there anyway of preventing this box from appearing?

Thanks in advance.
Jon
Aug 6 '07 #1
Share this Question
Share on Google+
3 Replies


Scott Price
Expert 100+
P: 1,384
Do a search on this site for keyword "setwarnings"

I believe your syntax in VBA will be:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.Setwarnings False
  2.  
  3. your code...
  4.  
  5. DoCmd.Setwarnings True
Remember to switch the warnings back on after your code executes, or they will be suppressed forever (at least as long as your app is executing) afterwards!!

Regards,
Scott
Aug 6 '07 #2

P: 31
Thanks, Scott. It worked a treat!
Aug 6 '07 #3

Scott Price
Expert 100+
P: 1,384
You're welcome, and welcome to The Scripts!

Regards,
Scott
Aug 6 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.