not show pop out window

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

Guest

I have a update query. When I run the query, it always pop out three windows
to ask you to confirm you are runing the query and some data can't be updated
because some calculated data missing. Is there any way to make these windows
do not pop out every time when run the query?
 
I have a update query. When I run the query, it always pop out three windows
to ask you to confirm you are runing the query and some data can't be updated
because some calculated data missing. Is there any way to make these windows
do not pop out every time when run the query?

I would recommend either #1 or #2 below.

1) Run the query from code:

DoCmd.SetWarnings False
DoCmd.OpenQuery "QueryName"
DoCmd.SetWarnings True

Or..
2) Don't actually use the query, use the Execute method instead (again
in code).

Dim strSQL as String
strSQL = "Update YourTable Set YourTable.[FieldName] = 'XYZ';"

CurrentDb.Execute strSQL,dbFailOnError

No warning will be given. An error message will be shown if there is a
problem.

Change the above strSQL to your Update query syntax. Variable, if
used, must be concatenated into the Update syntax, not hard coded.

Or..
3) Click on Tools + Options + Edit/Find
Uncheck the Confirm Action Queries check box
This is highly NOT Recommended, as it will shut off warnings
throughout the database for all queries.
 
Thank you very much. It works very well.

fredg said:
I have a update query. When I run the query, it always pop out three windows
to ask you to confirm you are runing the query and some data can't be updated
because some calculated data missing. Is there any way to make these windows
do not pop out every time when run the query?

I would recommend either #1 or #2 below.

1) Run the query from code:

DoCmd.SetWarnings False
DoCmd.OpenQuery "QueryName"
DoCmd.SetWarnings True

Or..
2) Don't actually use the query, use the Execute method instead (again
in code).

Dim strSQL as String
strSQL = "Update YourTable Set YourTable.[FieldName] = 'XYZ';"

CurrentDb.Execute strSQL,dbFailOnError

No warning will be given. An error message will be shown if there is a
problem.

Change the above strSQL to your Update query syntax. Variable, if
used, must be concatenated into the Update syntax, not hard coded.

Or..
3) Click on Tools + Options + Edit/Find
Uncheck the Confirm Action Queries check box
This is highly NOT Recommended, as it will shut off warnings
throughout the database for all queries.
 
Back
Top