Turns warning messages on or off.
DoCmd.SetWarnings WarningsOn
where WarningsOn is a Boolean that indicates whether warning messages are on (True) or off (False).
See the example for the Rename method.
Once you turn warning messages off, they remain off until you turn them back on. Since these messages are often warnings about potentially overwritten and deleted files, and since suppressing warnings amounts to automatically confirming all operations, it is extremely important that you enable warning messages again before your routine terminates.
The SetWarnings method has no effect on error messages.
The SetWarnings method suppresses only modal dialog boxes that allow the user to select command button options (Yes and No, or Yes, No, and Cancel). It does not suppress dialog boxes that expect other forms of user input.