13

I use a form to run a few codes on a database in Access. During update or deletion Access asks whether you want to update or delete.

I would like to know if there is any way of turning off these system messages or let the user choose his preference on whether he would like thoses messages to pop up or not.

Blackbam
  • 17,496
  • 26
  • 97
  • 150
tksy
  • 3,429
  • 17
  • 56
  • 61

1 Answers1

21

Don't foget to turn these back on.

DoCmd.SetWarnings false
DoCmd.SetWarnings true

Application.DisplayAlerts = false
Application.DisplayAlerts = true
LeppyR64
  • 5,251
  • 2
  • 30
  • 35
  • any way for the user to choose this – tksy Dec 18 '08 at 13:52
  • 1
    You could create a form so that the user could choose this option. If you don't turn it back on, it can cause some serious issues. "Whoops I accidentally deleted the table, but it normally asks me before I do that..." – LeppyR64 Dec 18 '08 at 14:00
  • If these update or deletes are being made programmatically from vba, just turn SetWarnings off, execute the query, turn SetWarnings on. – LeppyR64 Dec 18 '08 at 14:04
  • 1
    I would echo Jason Lepack and also mention that changing these warnings applies to every database on the PC, not just the one you are working on, so they are quite dangerous to meddle with. – Fionnuala Dec 18 '08 at 14:31
  • hmmm any other ideas other than using this. I mean i am trying to automate the process and it is tiresome if 20 or 30 table are updated and each keeps asking do u want to update? – tksy Dec 18 '08 at 14:37
  • 1
    Generally it is best to use CurrentDB.Execute strSQL, dbFailOnError for update queries. You can also get records affected if you do this. – Fionnuala Dec 18 '08 at 16:17
  • 1
    I've posted a function to make it easy to use CurrentDB.Execute. The code is posted here http://stackoverflow.com/questions/343396/acess-vba-to-get-value-from-update-query-prompt#348453 . – David-W-Fenton Dec 19 '08 at 01:49