How do you suppress error messages?

  • Thread starter Thread starter Laurel
  • Start date Start date
L

Laurel

I've seen it done.... some object and its property is set to false....
But I've looked in help under err and error..... Tried searching my existing
databases for 'false...' but there goes madness.
 
I've seen it done.... some object and its property is set to false....
But I've looked in help under err and error..... Tried searching my existing
databases for 'false...' but there goes madness.

It's:

DoCmd.SetWarnings False
'Do your thing here
DoCmd.SetWarnings True

BUT ... you need to be careful to *always* turn the warnings back on or you may
not be notified of important errors anywhere else in your application. The best
approach is to also include error handling in your procedures, in the exit point
of which you want to set warnings to True in the event that an trappable error
occurs after turning warnings to False.
 
I think Bruce was thinking of warnings,e.g. updating Records / deleting
Records and not errors.

AFAIK, to ignore errors (in VBA), you need to trap the errors and then
ignore them. This can be as simple as the statement:

On Error Resume Next

but I wouldn't recommend this for everything.

Check Access *VB* Help topic "Error trapping".

HTH
Van T. Dinh
MVP (Access)
 
I think Bruce was thinking of warnings,e.g. updating Records / deleting
Records and not errors.

Yes said:
AFAIK, to ignore errors (in VBA), you need to trap the errors and then
ignore them. This can be as simple as the statement:

On Error Resume Next

but I wouldn't recommend this for everything.

Check Access *VB* Help topic "Error trapping".

Thanks, Van.
 
Back
Top