Skip to content

Latest commit

 

History

History
47 lines (29 loc) · 1.43 KB

Access.DoCmd.SetWarnings.md

File metadata and controls

47 lines (29 loc) · 1.43 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
DoCmd.SetWarnings method (Access)
vbaac10.chm4183
vbaac10.chm4183
Access.DoCmd.SetWarnings
fe8cbd54-fa63-4057-8ea2-da9ba79ed1a6
01/18/2019
medium

DoCmd.SetWarnings method (Access)

The SetWarnings method carries out the SetWarnings action in Visual Basic.

Syntax

expression.SetWarnings (WarningsOn)

expression A variable that represents a DoCmd object.

Parameters

Name Required/Optional Data type Description
WarningsOn Required Variant Use True (1) to turn on the display of system messages and False (0) to turn it off.

Remarks

Use the SetWarnings method to turn system messages on or off.

If you turn the display of system messages off in Visual Basic, you must turn it back on, or it will remain off, even if the user presses Ctrl+Break, or Visual Basic encounters a breakpoint. You may want to create a macro that turns the display of system messages on and then assign that macro to a key combination or a custom menu command. You could then use the key combination or menu command to turn the display of system messages on if it has been turned off in Visual Basic.

Example

The following example turns the display of system messages off.

DoCmd.SetWarnings False

[!includeSupport and feedback]