Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code in VBA to disable cofirmation message

Status
Not open for further replies.

navdha88

Programmer
May 1, 2003
8
0
0
CA
Hello:

I have a form based on append queries. There are 7 append queries.
Each time when I runthe form, it is asking for confirmation messages 7 times.

Could someone give me the code in VBA to stop this confirmation message from appearing.

I know I can stop this if I go to TOOLS-OPTIONS-CONFIRM.... I am looking for the codes here.
I tried ACCESS help but nothing worked out so far.
Thanks for the help.
 
The SetWarnings method carries out the SetWarnings action in Visual Basic. For more information on how the action and its argument work, see the action topic.

Syntax

DoCmd.SetWarnings warningson

The SetWarnings method has the following argument.

Argument Description
warningson Use True (–1) to turn on the display of system messages and False (0) to turn it off.
Remarks

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

Don't forget to set it back to True after your routine finishes!!

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top