Confiming action queries i Access runtime

I've made an application i Access2000, used the "Packaged and Deployment Wizard" and created a free runtime version.
In Acccess, before making the runtime version, the "Confirm action queries" i turn off (under tools-options-edit/find).
When using the runtime version the "Confirm action queries" is turned back on again. This causes an irritating message window to pop up every time a action query is ran.
Is it possible to switch off this function in the runtime version?
oddehAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

paaskyCommented:
hello oddeh,

this works with Access 97 (try if it works with A2K!)

            Application.SetOption "Confirm Action Queries", False  

Regards,
Paasky
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brewdogCommented:
You might also consider using

currentdb.execute "YourQuery"

instead of whatever method you are currently using on your action queries (DoCmd.OpenQuery or DoCmd.RunSQL). The Execute method will never ask those irritating questions and also includes the .RecordsAffected property so you could check (and tell users) how many records were added/deleted/updated.

brewdog
0
jsnyder072199Commented:
What you probably need to do is modify the code before running an action query to setwarnings off and then turn on setwarnings after you execute the query.  You can do this in a macro with the setwarnings keyword or in code with the 'setwarnings = true/false' statment.  You should get in the habit of doing it this way anyway so that you don't have to change the global setting under tools|options.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

redl1neCommented:
I ran into this a while back, here's what I did..

DoCmd.SetWarnings(False)
DoCmd.RunSQL "insert your query's sql"
DoCmd.SetWarnings(True)

You can either have an action button or a macro call the code.

0
brewdogCommented:
redl1ne:

Welcome to EE! I notice you're new around here, so I wanted to welcome you and give you a couple pieces of information about our protocol.

The official EE suggestion is for experts to post Answers so that questions aren't deleted without someone receiving their just due. However, in the Access forum, at least, we have found that having everyone post Comments first works better all the way around.

By posting an Answer, you have just "locked" the question, meaning that most other experts won't look at it, and oddeh might miss out on some valuable information. (You also run the risk of building up bad blood between you and other experts. :o)  )

In this particular case, your move was particularly bad, because three others of us had posted equally valid suggestions; indeed, the expert posting right before you suggested the exact same thing you did.

I believe that EE has added a feature allowing you to change your Answer to a Comment. If so, please do. If not, oddeh should reject your Answer.

Again, welcome to EE. We're really very nice when you get used to us. :o)

brewdog
0
lmerrellCommented:
.. and we're not really that hard to get used too!  ;-)

lmerrell
0
BrianWrenCommented:
I don't believe that the status of action queries' confirmation is kept with the database, but is kept with the machine.

If that is the case you should add to your application that it turns off the query confirmation when it runs.  You can do this in a macro, or through a function.

Also, if that is the case, if the options get changed by another session of Access, the options will retain that new setting.

Brian
0
BrianWrenCommented:
When I set Confirmation on, apply the change, then quit the db and open a different one, the change persists.

Then in the newly-opened DB I change it again, and it is the new way when I open the old DB.
0
paaskyCommented:
BrianWren,

You're right that the setting effects to all databases opened that machine.

oddeh,

For that reason I disable warnings (set option property False) in application startup and put it on when user quits application. When you disable "Confirm Action Queries" option in application start you don't have to set Warnings Off-On every time you run a query.

This function is called from the startup form or Autoexec macro

Public Function Initialize() as Boolean
   Application.SetOption "Confirm Action Queries", False    
....
End Function


And this function to quit application:

Public Function Quit_Application()
   if msgbox ("Do you want to quit",vbYesNo,"Quit?") = vbNo then exit sub
   Application.SetOption "Confirm Action Queries", True    
....
End Function

Regards,
Paasky
0
paaskyCommented:
Line: if msgbox ("Do you want to quit",vbYesNo,"Quit?") = vbNo then exit sub

should be:
if msgbox ("Do you want to quit",vbYesNo,"Quit?") = vbNo then exit function


0
oddehAuthor Commented:
Thanks, it works in your way. But I was looking for something that globally turned off Action Queries for the hole application.

The proposal from "paasky" suite me in a better way. It let me disable the function when the application starts.

Thanks anyway!

OddEH
0
oddehAuthor Commented:
Thanks!

This is exactly what I was looking for!

It's a honour to pay you off with 200 points.

OddEH
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.