0

I wrote a statement below in Access VBA.

DoCmd.RunSQL "delete * from sys_AAAA_AAAA where AAA='apple'"

But Access asks me to confirm with a message box.

enter image description here

As I will have to repeat this command many times. Is there a way of suppressing this warning message or giving a 'yes' with a statment?

Many thanks.

Erik A
  • 31,639
  • 12
  • 42
  • 67
davidzxc574
  • 471
  • 1
  • 8
  • 21
  • 1
    Possible duplicate of [Access vba: How to turn of systems messages or prompts?](https://stackoverflow.com/questions/377878/access-vba-how-to-turn-of-systems-messages-or-prompts) – Nick.Mc Jul 15 '17 at 05:41
  • or google for `docmd runsql suppress warning`. – R.S. Jul 15 '17 at 05:59

1 Answers1

4

Don't touch the warnings. Just use:

CurrentDb.Execute "delete * from sys_AAAA_AAAA where AAA='apple'"
Gustav
  • 53,498
  • 7
  • 29
  • 55