Supressing all system messages

rocklee

Registered User.
Local time
Today, 04:22
Joined
May 14, 2009
Messages
36
Hi folks,

I know that there is an escape module that can be created to determine different errors and print out a custom message instead of the system message like in the following :

Code:
On Error GoTo Err_End_Click

Err_End_Click:

Select Case Err.Number
    Case Else
        MsgBox ("There is no record to update!")
End Select
Resume Exit_End_Click

But how can I prevent system messages for things like adding,updating and deleting records?
 
In code you can turn off these warnings temporarily by using this code:

Code:
DoCmd.SetWarnings False  'Turn warnings off
   'Code here to do whatever is throwing up the warning
DoCmd.SetWarnings True    'Turn warnings back on
Be sure to place the

DoCmd.SetWarnings True

line to turn warnings back on. You should also include this line in an error handler for the sub in case an error occurs, otherwise the warnings will remain off, and you may need them !
 

Users who are viewing this thread

Back
Top Bottom