Disallow Bypass Key and Code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dalan

    Disallow Bypass Key and Code

    Perhaps someone knows how to structure the correct VBA code to use for
    allowing or disallowing use of the bypass key, because the code that I
    used as suggested by MSAccess 97 has failed to work. A copy of the
    same is pasted below. Any assistance will be appreciated. Thanks,
    Dalan

    Sub SetStartupPrope rties()

    ChangeProperty "StartupShowDBW indow", dbBoolean, True
    ChangeProperty "AllowSpecialKe ys", dbBoolean, True
    ChangeProperty "AllowBypassKey ", dbBoolean, False

    End Sub


    Function ChangeProperty( strPropName As String, varPropType As Variant,
    varPropValue As Variant) As Integer
    Dim dbs As Database, prp As Property
    Const conPropNotFound Error = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties( strPropName) = varPropValue
    ChangeProperty = True

    Change_Bye:
    Exit Function

    Change_Err:
    If err = conPropNotFound Error Then ' Property not found.
    Set prp = dbs.CreatePrope rty(strPropName , varPropType,
    varPropValue)
    dbs.Properties. Append prp

    Resume Next
    Else
    ' Unknown error.
    ChangeProperty = False
    Resume Change_Bye
    End If
    End Function
  • Rick Brandt

    #2
    Re: Disallow Bypass Key and Code

    "Dalan" <other@safe-mail.net> wrote in message
    news:504f21f6.0 311190611.7035e 967@posting.goo gle.com...[color=blue]
    > Perhaps someone knows how to structure the correct VBA code to use for
    > allowing or disallowing use of the bypass key, because the code that I
    > used as suggested by MSAccess 97 has failed to work. [snip][/color]

    Failed to work how? The property changed don't have an effect on the
    current session, but should be in effect if you close and reopen the file.


    --
    I don't check the Email account attached
    to this message. Send instead to...
    RBrandt at Hunter dot com


    Comment

    • Dalan

      #3
      Re: Disallow Bypass Key and Code

      "Rick Brandt" <rickbrandt2@ho tmail.com> wrote in message news:<bpg3oa$1l pbdu$1@ID-98015.news.uni-berlin.de>...[color=blue]
      > "Dalan" <other@safe-mail.net> wrote in message
      > news:504f21f6.0 311190611.7035e 967@posting.goo gle.com...[color=green]
      > > Perhaps someone knows how to structure the correct VBA code to use for
      > > allowing or disallowing use of the bypass key, because the code that I
      > > used as suggested by MSAccess 97 has failed to work. [snip][/color]
      >
      > Failed to work how? The property changed don't have an effect on the
      > current session, but should be in effect if you close and reopen the file.[/color]

      Simply, after exiting the database and then restarting it by holding
      the Shift key down, the database window is shown (several tries). I
      had presumed that by not allowing the Shift key to be functional that
      it would not permit this, but seemingly, it has no effect. So maybe
      someone knows of a workaround for this issue, or a better piece of
      code. Thanks.

      Comment

      • Peter Russell

        #4
        Re: Disallow Bypass Key and Code

        Dalan previously wrote:
        [color=blue]
        > "Rick Brandt" <rickbrandt2@ho tmail.com> wrote in message[color=green]
        > > news:<bpg3oa$1l pbdu$1@ID-98015.news.uni-berlin.de>...
        > > "Dalan" <other@safe-mail.net> wrote in message
        > > news:504f21f6.0 311190611.7035e 967@posting.goo gle.com...[color=darkred]
        > > > Perhaps someone knows how to structure the correct VBA code to use
        > > > for
        > > > allowing or disallowing use of the bypass key, because the code
        > > > that I
        > > > used as suggested by MSAccess 97 has failed to work. [snip][/color]
        > >
        > > Failed to work how? The property changed don't have an effect on the
        > > current session, but should be in effect if you close and reopen the
        > > file.[/color]
        >
        > Simply, after exiting the database and then restarting it by holding
        > the Shift key down, the database window is shown (several tries). I
        > had presumed that by not allowing the Shift key to be functional that
        > it would not permit this, but seemingly, it has no effect. So maybe
        > someone knows of a workaround for this issue, or a better piece of
        > code. Thanks.
        >[/color]

        The code looks OK to me.
        How are you running kit?

        However, before running this you must provide yourself with a reset
        procedure. You would normally run the reset from another mdb file.

        Regards

        Peter Russell






        Comment

        Working...