Link to home
Start Free TrialLog in
Avatar of Johannes030399
Johannes030399

asked on

Confirm Action Queries

I would like to turn off the three checkboxes under "Tools--Options--Edit/Find Tab--Confirm" using a macro or visual basic code.  These checkboxes turn off confirmation messages for Action Queries, Record Changes, and Document Deletions.

These settings are not saved with the database, instead they are computer specific.  I would like to be able to turn them off when starting up an application so that each user does not have to go in and manually turn them off.

I am aware of the SetWarnings method, but it seems to turn off more than what I want it to (all modal messages).  
ASKER CERTIFIED SOLUTION
Avatar of paasky
paasky
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of berg1375
berg1375

If you set the warnings to false on start up, you can then set them back to true when you are done with the code and startup.

If you want to restore the original setting value (user may have turned warnings off), you should store the value in the table or global variable.

To get the value of this setting, here's an example:

OriginalSetting = Application.GetOption ("Confirm Action Queries")

Paasky
These are registry settings.  

HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Access\Settings

Confirm Action Queries
Confirm Document Deletions
Confirm Record Changes

These are DWORDs, Set to 0 for no confirmation.
and then assign the original value of setting when you quit:

Public OriginalSetting As Boolean

.....

Application.SetOption "Confirm Action Queries", OriginalSetting  
Avatar of Johannes030399

ASKER

Thanks.  It's a little slower than I expected (hoped) it would be, but I guess there is no way around that.
Keep in mind all other Access instances will also be affected by the changes made by your application.  You might also consider doing these registry changes during an install, instead of each session.
You're welcome Johannes.

Regards,
Paasky