General discussion

Locked

Access 97 Runtime - controlling options

By martil ·
I generated a runtime version of a database, and when it is installed, all the Action Queries request confirmation. That option is not checked in Options on my system. How do you turn it off in the runtime version. If need VBA code, what is the code?

This conversation is currently closed to new comments.

13 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access 97 Runtime - controlling options

by kempj In reply to Access 97 Runtime - contr ...

If you are calling the action query in a macro or in vb then you can turn off messages either by using the command SetWarnings in the macro before running the action query or using an equivalent in vb
Hope this helps

Collapse -

Access 97 Runtime - controlling options

by martil In reply to Access 97 Runtime - contr ...

The question was auto-closed by TechRepublic

Collapse -

Access 97 Runtime - controlling options

by IrishTLR In reply to Access 97 Runtime - contr ...

You can also include YOUR system.mdw file in your distribution. This stores whether confirmations are on or not

Collapse -

Access 97 Runtime - controlling options

by martil In reply to Access 97 Runtime - contr ...

The question was auto-closed by TechRepublic

Collapse -

Access 97 Runtime - controlling options

by Crowmoor In reply to Access 97 Runtime - contr ...

If you just dubbelklick on an actionquery then its more difficult but if you run them from a form just add the following code to the clickevent on your button (or the event that you use)

DoCmd.SetWarnings False 'turns warnings off

(your code here eg DoCmd.OpenQuery "QueryName"
DoCmd.OpenReport "ReportName")

DoCmd.SetWarnings True 'turns warnings on

If you use Macro then include
SetWarnings with parameter False first and
parameter True Last.


If you have more questions then feel fre to mail me.

Jesper Kr?khede

Collapse -

Access 97 Runtime - controlling options

by martil In reply to Access 97 Runtime - contr ...

The question was auto-closed by TechRepublic

Collapse -

Access 97 Runtime - controlling options

by mcorr In reply to Access 97 Runtime - contr ...

The best answer to this is to set the program options the way you want them when the program starts. Then if you are nice you set them back the way they were when you started.

1. Declare globals (in a module) to hold the initial states of the options.
Public OPTIONRecChanges As Variant
Public OPTIONActionQueries As Variant

2. Read initial values in FormOpen of first form (splash, switchboard, etc.)
' Get the options for this location
OPTIONRecChanges = Application.GetOption("Confirm Record Changes")
OPTIONActionQueries = Application.GetOption("Confirm Action Queries")

3. Set desired values in same event as #2.
' Now set the confirm options off
Application.SetOption "Confirm Record Changes", False
Application.SetOption "Confirm Action Queries", False

4. Make a close program event that the switchboard or other form calls to close. Reset the initial values found in #2.
' Set the confirm options to their state when started.
Application.SetOption "Confirm Rec

Collapse -

Access 97 Runtime - controlling options

by martil In reply to Access 97 Runtime - contr ...

The question was auto-closed by TechRepublic

Collapse -

Access 97 Runtime - controlling options

by mickfranzen In reply to Access 97 Runtime - contr ...

Get the SQL script for the query (You may already have it)

run theis piece of code (short an simple)

Dim dbsdb as database
set dbsdb = currentdb
dbsdb.execute (SQL)

And query will run

Collapse -

Access 97 Runtime - controlling options

by martil In reply to Access 97 Runtime - contr ...

The question was auto-closed by TechRepublic

Back to Web Development Forum
13 total posts (Page 1 of 2)   01 | 02   Next

Software Forums