How do you suppress error messages?

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.
 
B

Bruce M. Thompson

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.
 
V

Van T. Dinh

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)
 
B

Bruce M. Thompson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top