stopping warning message

shutzy

Registered User.
Local time
Today, 18:30
Joined
Sep 14, 2011
Messages
775
i have an update query. everytime i run it it comes up with a warning message. are you sure? etc. is there anyway of disabling just that message. or do i have to change some drastic properties for the whole database.

thanks
 
DoCmd.SetWarnings False
will turn off the display of the message

DoCmd.SetWarnings True
will turn it back on.

This property applies to the database.
So before you run the query, set warnings to false and when finished the query turn it back on again.
 
of course the problem is that if it doesnt work, or only works partially - you don't know!

so an alternative is currentdb.execute .... which works slightly differently again
 
gemma, could you expand on 'if it dosnt work'. which part the update query or the stop warning.
 
jeanette, i dont really know anything about vba and i prefer to use macros(purely because i know just a little more about them than vba)

is there a way i can do this by using macros. the update query is run by a macro and it sould be pretty easy to slot the warning disabler in before and after.
 
Select the 'SetWarnings' option at the start of your Macro, set it to 'No'
At the end of your macro, select the 'SetWarnings' option and set it to 'Yes'

If SetWarnings is not there, select 'Show All Options' button in the main menu ribbon.

Does this do what you need?
 
thanks tinyevil. i thought that i had all the available macros in the list but it turned out that i hadnt. yes it worked flawlessley. cheers.
 
ok what i meant was this

lets say you are running an update query - and some of the updates requested fail, because you are trying to set an illegal value, or something that is not permitted by a validation rule .....

or you are trying to insert new data, maybe from a spreadsheet yuo uploaded, and some rows are duplicates, or cannot be added ...

then if you turn the warnings off, you never know the action failed. (partially) because you suppressed the warning.
 

Users who are viewing this thread

Back
Top Bottom