Access Options Confirm: Record changes, document deletions, action queries (1 Viewer)

gstreichan

Registered User.
Local time
Today, 09:48
Joined
Apr 1, 2014
Messages
28
Dears,

I have a split frontend database that I place in server for users to copy, paste and open it through their desktops. We are all connected to same server, of course.
However, this database has some action queries, which I have previously set in File>Options>Client Settings>Confirm as (false) unchecked. I don't want users to have all questions related to table deletions, appending and creating new table after clicking on a button in form.

The issue is being, when users copy new frontend from server, paste on their computers (replacing old one), these File>Options>Client Settings>Confirm Record changes, document deletions, action queries checkboxes are set back to true checked then all get these confirmation questions.

I have a USysRibbons table with a RibbonXML that I don't allow users to see any header, navigation buttons, File>Options as well. I also block shift before I send it out then it is quite protected in my point of view. The question is, is there a way to keep same options as "false" when I have users performing as explained above?

I really appreciate an answer on this.
 

isladogs

MVP / VIP
Local time
Today, 08:48
Joined
Jan 14, 2017
Messages
18,221
Add this code in the load event of a startup form or an autoexec macro

Rich (BB code):
Application.SetOption "Confirm Record Changes", False
Application.SetOption "Confirm Document Deletions", False
Application.SetOption "Confirm Action Queries", False

For details of other properties you can set, see
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:48
Joined
May 7, 2009
Messages
19,243
distribute an .accde or .accdr version of your db.
 

ebs17

Well-known member
Local time
Today, 09:48
Joined
Feb 7, 2020
Messages
1,946
Don't use calls like...
Code:
DoCmd.RunSQL sSQL
DoCmd.OpenQuery sQueryName
... but something like that
Code:
CurrentDb.Execute sSQL, dbFailOnError
CurrentDb.Execute sQueryName, dbFailOnError
Then you don't get any of the messages described, but with the attribute dbFailOnError there is a message in the event of an error (which is absolutely necessary). In addition, there is a rollback, i.e. a reset to the initial state and thus to a usable defined state.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:48
Joined
Feb 19, 2002
Messages
43,275
Setting confirm changes off is extremely dangerous. Do not do this as a standard policy. You will eventually be very sorry you did. All you have to do is just ONCE forget to save a code module you worked on for hours before you close the form. Access will silently discard your changes assuming you knew what you were doing when you set warnings off.

There are two options.
1. Use the execute method
2. turn the warnings off before running an action query and then turn them back on immediately.

In all my applications I have just two macros.
SetWarningsOff
SetWarningsOn

The reason I use a macro is because I really want to run two commands and this lets me do it with one line of code. The second command is to turn the hourglass on when warnings are off and turn the hourglass off when warnings are on. Why? Because I want to make sure I know absolutely that the warnings got turned back on again. Sometimes during testing code gets stopped in the middle of the operation. The hourglass is so annoying that it forces me to just go and manually run the "on" macro.

Once you have lost hours of work because you had warnings off, you never forget again. You also learn to save code early and often;)
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 08:48
Joined
Jan 14, 2017
Messages
18,221
I answered the question as asked, but agree with both @ebs17 and @Pat Hartman that a much better approach is to use dB.Execute with dbFailOnError.

Saving a file as .accde does not remove warnings.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 08:48
Joined
Sep 12, 2006
Messages
15,656
Dears,

I have a split frontend database that I place in server for users to copy, paste and open it through their desktops. We are all connected to same server, of course.
However, this database has some action queries, which I have previously set in File>Options>Client Settings>Confirm as (false) unchecked. I don't want users to have all questions related to table deletions, appending and creating new table after clicking on a button in form.

The issue is being, when users copy new frontend from server, paste on their computers (replacing old one), these File>Options>Client Settings>Confirm Record changes, document deletions, action queries checkboxes are set back to true checked then all get these confirmation questions.

I have a USysRibbons table with a RibbonXML that I don't allow users to see any header, navigation buttons, File>Options as well. I also block shift before I send it out then it is quite protected in my point of view. The question is, is there a way to keep same options as "false" when I have users performing as explained above?

I really appreciate an answer on this.
I can't imagine why you would want users to delete tables. Well I can, but in such cases, I would want to get explicit confirmation. The thing is, it's difficult to know which confirmation messages can safely be turned off. A new user might need to see some messages that a seasoned user would not. Some messages indicate a status that needs to be seen. It's actually quite hard to get users to read and react to messages when they should, rather than just ignore them, and then claim something went wrong.

If users update databases, then their user settings need to be saved somewhere that does not get updated, and can be reloaded at startup. Maybe in an ini file/ text file, or a backend table, or even in the registry (savesetting, getsetting)
 

Users who are viewing this thread

Top Bottom