Disabling Confirmation Messages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Under Options, Edit/Find.. I've already unchecked the three boxes under
Confirm, but I'm still getting confirmation pop-ups when running queries. I
don't know what else to check to disable these windows from showing up. Any
ideas? Thank you.
 
Under Options, Edit/Find.. I've already unchecked the three boxes under
Confirm, but I'm still getting confirmation pop-ups when running queries. I
don't know what else to check to disable these windows from showing up. Any
ideas? Thank you.

Put a line

DoCmd.SetWarnings False

before executing the query, and

DoCmd.SetWarnings True

afterward (or use the SetWarnings action in the same manner if you're
using Macros to run the queries).

John W. Vinson[MVP]
 
4saken ha scritto:
Under Options, Edit/Find.. I've already unchecked the three boxes under
Confirm, but I'm still getting confirmation pop-ups when running queries. I
don't know what else to check to disable these windows from showing up. Any
ideas? Thank you.

Is not a ggod idea to disable from Option the Warnings...!

This one depend by the method used to invoke a query execution.

Using Macro you are any way to disable it...!

Using code you have 2 way:

1)RunSQL metod
This need to set the Warning to false before run SQL statement and
restore it
after execution.

To work with this you need of SetWarnings(WarningsOn) Method Member
of
Access.DoCmd

In OnLineHelp you can fined all you need about it:

DoCmd.SetWarnings False
Docmd.RunSQL "QueryName"
DoCmd.SetWarnings True

You may put This code on a ClickButtonEvent to test it....!

2) Execute Metod
This don't need anything else because work directly on JET db, so a
single code line
is needed.
Execute like Execute(Query As String, [Options]) Member of
DAO.Database

Ex:

strModificaSQL = "UPDATE T1 SET fld1...."
CurrentDb.Execute strModificaSQL

You can also use Execute member of DAO.Connection but..... i don't
think may be
this case.

3) ADO and Execute Method member of ADODB.Connection
This don't require any Warnings Mask....
CurrentProject.Connection.Execute "UPDATE T1 SET fld1...."


@Alex
 
On Sun, 20 Aug 2006 09:21:01 -0700, 4saken

I was assuming - probably incorrectly, and I apologize for not
clarifying - that you were executing the Queries in VBA code from a
command button. Or perhaps from a Macro (again from a button).

WHat's the context? How are you in fact running the queries?
Where exactly am I putting this in? Thanks for the reply.

John W. Vinson[MVP]
 
I am running the queries from a macro, associated with a button.

In that case, on the line before the first query, select "Setwarnings"
as the action, and set its value to False. Be sure to put a similar
line setting Setwarnings to True after the last query, or you'll turn
off all warning messages!

John W. Vinson[MVP]
 
Back
Top