General discussion

  • Creator
    Topic
  • #2082140

    Access 97 Runtime – controlling options

    Locked

    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?

All Comments

  • Author
    Replies
    • #3901603

      Access 97 Runtime – controlling options

      by kempj ·

      In reply to Access 97 Runtime – controlling options

      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

    • #3896641

      Access 97 Runtime – controlling options

      by irishtlr ·

      In reply to Access 97 Runtime – controlling options

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

    • #3898973

      Access 97 Runtime – controlling options

      by crowmoor ·

      In reply to Access 97 Runtime – controlling options

      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

    • #3895872

      Access 97 Runtime – controlling options

      by mcorr ·

      In reply to Access 97 Runtime – controlling options

      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

    • #3895515

      Access 97 Runtime – controlling options

      by mickfranzen ·

      In reply to Access 97 Runtime – controlling options

      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

    • #3771446

      Access 97 Runtime – controlling options

      by acwiz ·

      In reply to Access 97 Runtime – controlling options

      Not a good idea to leave warnings off all the time. Here are two sub’s I use where I need to turn the warnings and hourglass on and off

      Sub HgOffWarnOn()
      On Error GoTo HgOffWarnOn_ERR
      DoCmd.SetWarnings True
      DoCmd.Hourglass False
      ExitSub

      HgOffWarnOn_ERR:
      MsgBox “An error has occurred.: ” & Error$
      Resume Next
      End Sub

      Sub HgOnWarnOff()
      On Error GoTo HgOnWarnOff_ERR
      DoCmd.SetWarnings False
      DoCmd.Hourglass True
      Exit Sub

      HgOnWarnOff_ERR:
      MsgBox “An error has occurred.: ” & Error$
      Resume Next
      End Sub

    • #3741306

      Access 97 Runtime – controlling options

      by martil ·

      In reply to Access 97 Runtime – controlling options

      This question was auto closed due to inactivity

Viewing 6 reply threads