Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to get Action Query Confirm Message? (a2k (9.0.3821) SR-1 Jet 4.0 )

    How to get Action Query Confirm Message?
    a2k (9.0.3821) SR-1 Jet 4.0

    In Tools. Options, Edit/Find Tab I have Action Queries unchecked.

    I only want the Action Query for this one procedure.

    When I run the following from a from button it dosen

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to get Action Query Confirm Message? (a2k (9.0.3821) SR-1 Jet 4.0

    You can check the Confirm Action Queries option in code.

    ' Variable to hold current setting
    Dim blnConfirmActionQueries As Boolean

    ' Get current setting
    blnConfirmActionQueries = Application.GetOption("Confirm Action Queries")

    ' Set option to True temporarily
    Application.SetOption "Confirm Action Queries", True

    ' Execute the query
    DoCmd.OpenQuery mstrUpdateQuery

    ' Restore original setting, whatever it was
    Application.SetOption "Confirm Action Queries", blnConfirmActionQueries

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to get Action Query Confirm Message? (a2k (9.0.3821) SR-1 Jet 4.0

    Hi Hans

    Worked great!

    What strategy do developers use to make sure the application settings are correct for this database session and are returned to what they were when this database is closed?

    I like your example of saving previous value, making the change and then resetting the original value.

    Has anyone developed a tblSaveOption table that is used to store options in effect on enrty, make the changes necessary option changes for the current session and restore the option settings from tblsaveOption table on application close?

    If a customer is using mdb's from two different developers, it seems this would give the developer control over the way application behaves and not messing it up for the user when they uses the other application.

    Thanks, John

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How to get Action Query Confirm Message? (a2k (9.0.3821) SR-1 Jet 4.0

    I've done something like that with a USys table, but if you only want to do this during development, why not just make yourself a list of the things to set back and turn the option on during development? We use Access security and have startup code in our applications that set options the way we want them to be for the user. If you're using Access security, you could have a test to bypass that reset if the user is a developer.
    Charlotte

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to get Action Query Confirm Message? (a2k (9.0.3821) SR-1 Jet 4.0

    Hi Charlotte

    I

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How to get Action Query Confirm Message? (a2k (9.0.3821) SR-1 Jet 4.0

    Options are set for Access, not for individual databases, so storing settings in a table would be one method of insuring that the desired settings would always be in place. I would use something like a USysSettings table, with 2 fields, SettingName and SettingValue. You could have a third field that had a short name for the setting as well. In the SettingName field, put the string used in changing the setting from code and in the SettingValue field, store the value you want to use. The create a function you can use to retrieve the desired setting record and apply it if the current setting is different. I use this approach to store "globals" instead of using global variables, since the values can be retained between sessions this way. The function can be used to check the setting and to change it if need be. Another approach would be to store the values in a registry key, but that would not migrate between machines unless you created an installation package and included a registry text file to use in creating the key on the target machine.

    Here's a function I use to retrieve the default back end path from a user-defined system table called USysDBConstants, which has two fields, DBCName and DBCValue. I can then use DATA_PATH throughout my application to return the path stored in the static variable. If the value gets changed elsewhere, I can call DATA_PATH with the option flag set to True, and it will clear the static variable and repopulate it with the new path.

    <pre>Public Function DATA_PATH(Optional blnClear As Boolean)
    ' created by Charlotte Foust 9/9/2001

    Dim varResult As Variant 'holds DLookup value
    Static strPath As String

    If strPath = "" Or blnClear Then

    ' lookup the value
    varResult = DLookup("[DBCValue]", "USysDBConstants", _
    "[DBCName]='DataPath'")

    ' if a null is returned, check to see
    ' if the record actually exists

    If IsNull(varResult) Then

    varResult = DLookup("[DBCName]", "USysDBConstants", _
    "[DBCName]='DataPath'")

    ' if the record does not exist
    ' then return a False to the calling routine

    If IsNull(varResult) Then
    DATA_PATH = False
    Else
    strPath = ""
    DATA_PATH = strPath
    End If ' IsNull(varResult)

    ' otherwise, return the path
    Else
    strPath = CStr(varResult)
    DATA_PATH = strPath
    End If 'IsNull(varResult)
    Else
    DATA_PATH = strPath
    End If ' strPath = "" or blnClear
    End Function ' DATA_PATH(Optional strRootPath As String)</pre>

    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •