When running an update query is it possible to have it so the message you are about to run an update query, and the other one you are about to update xxx records, do not appear.
they are damn annoying anyone know how i can stop them appearing
When running an update query is it possible to have it so the message you are about to run an update query, and the other one you are about to update xxx records, do not appear.
Dave, if you are just running the query by clicking on it in the Database Window then there is one way to turn it off but it's not advised - goto Tools -> Options -> Edit/Find -> Confirm -> Action Queries
The reason it's not advised as this will disable all messages regarding queries within your database and you may miss out on information.
So, the best method - as Neil has correctly said - is to use the SetWarnings method in either a macro or code to turn off the warnings, run the query. What Neil forgot to say, however, is to turn the warnings back on otherwise you'll miss every warning with regards to your database such as Save Changes? Yes/No.
I won't say how to do this with a macro as I'm not a fan of them.
In code, the structure is:
Code:
With DoCmd.
.SetWarnings False
.OpenQuery "MyQuery"
.SetWarnings True
End With
Pat Hartman, one of the forum users, advises going one further than this and making that code:
Code:
With DoCmd.
.Hourglass True
.SetWarnings False
.OpenQuery "MyQuery"
.SetWarnings True
.Hourglass False
End With
This, effectively, turns your mouse pointer to an hourglass during the performing of the update query and then turns the hourglass back on once the operation is complete. As you won't be given an error message when the Warnings are turned off, the fact that your mouse remains as an Hourglass after the operation would be a visual indication that something has gone wrong.