tags:

views:

632

answers:

1

Hi,

I use a form to run a few codes on a database in access. During updation or deletion access asks whether u want to update or delete. I would like to know if there is any way of turning off theses system messages or let the user choose his preference on whether he would like thoses messages to pop up or not.

Thanks tksy

+2  A: 

Don't foget to turn these back on.

DoCmd.SetWarnings false
DoCmd.SetWarnings true

Application.DisplayAlerts = false
Application.DisplayAlerts = true
Jason Lepack
any way for the user to choose this
tksy
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..."
Jason Lepack
If these update or deletes are being made programmatically from vba, just turn SetWarnings off, execute the query, turn SetWarnings on.
Jason Lepack
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.
Remou
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
How are you performing the updates?
Jason Lepack
Generally it is best to use CurrentDB.Execute strSQL, dbFailOnError for update queries. You can also get records affected if you do this.
Remou
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