How do I programmatically change options in Access?

in Microsoft Access, is there a way that I can programmatically check the Confirm Action Queries checkbox on the False options screen? Ideally, when the database is running, I would like to check if it is true, and if so, mark it as false for the current user.

The app is locked down hard enough, so ideally we don't want to give users access to the action menu.

Thanks in advance.

PG

0


source to share


3 answers


Place the following in the method when starting the database:



If Application.GetOption("Confirm Action Queries") Then
    Application.SetOption "Confirm Action Queries", False
End If

      

+1


source


It is usually best to use Execute or Set Warnings to get rid of the valid query warning as the options apply to all databases. If you change the parameters in the code, I recommend that you set them back before exiting (and hope the exits are not unexpected), or someone might get a nasty surprise when the expected prompt does not appear in their application.



0


source


I am assuming that you want to disable this setting because you are making requests from code. You can disable all query requests using the SetWarnings macro. Available from VBA as a method of the DoCmd object. Remember to re-enable it after the code completes. You can also avoid the warning with the Execute method in ADO or DAO.

0


source







All Articles