Disabling the <shift> + <enter>

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

    #1

    Disabling the <shift> + <enter>


    I know that I saw some information concerning the <shift>+<ente r>
    combination use to bypass launching an Access mdb application and enter
    the Access design workspace. Would someone please direct me to some
    information on how to disable this function (and how to re-enable it)?
    I believe that I saw some article that showed how to incorporate this
    into a command button. That would work for me as I have three different
    sign-on authorities for my application and I would only display the
    command button for the 'admin' authority. Thanks, in advance, for your
    help.

    Sue


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Jim Allensworth

    #2
    Re: Disabling the &lt;shift&gt ; + &lt;enter&gt ;

    Take a look here for code to manage the AllowByPassKey property.



    - Jim

    On 19 Aug 2004 19:13:36 GMT, Susan Bricker <sbrick@att.net > wrote:
    [color=blue]
    >
    >I know that I saw some information concerning the <shift>+<ente r>
    >combination use to bypass launching an Access mdb application and enter
    >the Access design workspace. Would someone please direct me to some
    >information on how to disable this function (and how to re-enable it)?
    >I believe that I saw some article that showed how to incorporate this
    >into a command button. That would work for me as I have three different
    >sign-on authorities for my application and I would only display the
    >command button for the 'admin' authority. Thanks, in advance, for your
    >help.
    >
    >Sue
    >
    >
    >*** Sent via Developersdex http://www.developersdex.com ***
    >Don't just participate in USENET...get rewarded for it![/color]

    Comment

    • Mark R

      #3
      Re: Disabling the &lt;shift&gt ; + &lt;enter&gt ;

      I have just managed to accomplish this very thing.
      Paste the following code into a new module:

      Function ChangeProperty( strPropName As String, varPropType As Variant,
      varPropValue As Variant) As Integer
      Dim dbs As Object, prp As Variant
      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

      You then need to create two command buttons, one to disable the shift key,
      the other to enable it.

      Disable:
      Private Sub diable_Click()
      Const DB_Boolean As Long = 1
      ChangeProperty "AllowBypassKey ", DB_Boolean, False
      End Sub

      Enable:
      Private Sub enable_Click()
      Const DB_Boolean As Long = 1
      ChangeProperty "AllowBypassKey ", DB_Boolean, True
      End Sub

      Hope this helps,

      Mark
      "Susan Bricker" <sbrick@att.net > wrote in message
      news:4124fbe0$0 $14466$c397aba@ news.newsgroups .ws...[color=blue]
      >
      > I know that I saw some information concerning the <shift>+<ente r>
      > combination use to bypass launching an Access mdb application and enter
      > the Access design workspace. Would someone please direct me to some
      > information on how to disable this function (and how to re-enable it)?
      > I believe that I saw some article that showed how to incorporate this
      > into a command button. That would work for me as I have three different
      > sign-on authorities for my application and I would only display the
      > command button for the 'admin' authority. Thanks, in advance, for your
      > help.
      >
      > Sue
      >
      >
      > *** Sent via Developersdex http://www.developersdex.com ***
      > Don't just participate in USENET...get rewarded for it![/color]


      Comment

      • Susan Bricker

        #4
        Re: Disabling the &lt;shift&gt ; + &lt;enter&gt ;


        Mark,

        Great info. Thanks. One question, though? Why did you create
        "ChangeProperty " as a function and not as a sub? I see you are passing
        it some arguments. But what is the purpose of setting a return code
        value? Thanks, again.

        Sue

        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        • Mark R

          #5
          Re: Disabling the &lt;shift&gt ; + &lt;enter&gt ;

          To give some of you a laugh, I'll be honest. I'm not a programmer and have
          no idea what you are on about. The example I gave was found on the net by
          trawling through the access sites. Maybe one of the more experienced on
          here could give you the reason why the code is the way it is.

          Regards,

          Mark


          "Susan Bricker" <sbrick@att.net > wrote in message
          news:41250e9e$0 $14463$c397aba@ news.newsgroups .ws...[color=blue]
          >
          > Mark,
          >
          > Great info. Thanks. One question, though? Why did you create
          > "ChangeProperty " as a function and not as a sub? I see you are passing
          > it some arguments. But what is the purpose of setting a return code
          > value? Thanks, again.
          >
          > Sue
          >
          > *** Sent via Developersdex http://www.developersdex.com ***
          > Don't just participate in USENET...get rewarded for it![/color]


          Comment

          • MGFoster

            #6
            Re: Disabling the &lt;shift&gt ; + &lt;enter&gt ;

            When the function succeeds it returns True. When it fails it returns
            False. So the calling routine will "know" to do something, depending on
            the return value.

            --
            MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
            Oakland, CA (USA)


            Mark R wrote:[color=blue]
            > To give some of you a laugh, I'll be honest. I'm not a programmer and have
            > no idea what you are on about. The example I gave was found on the net by
            > trawling through the access sites. Maybe one of the more experienced on
            > here could give you the reason why the code is the way it is.
            >
            > Regards,
            >
            > Mark
            >
            >
            > "Susan Bricker" <sbrick@att.net > wrote in message
            > news:41250e9e$0 $14463$c397aba@ news.newsgroups .ws...
            >[color=green]
            >>Mark,
            >>
            >>Great info. Thanks. One question, though? Why did you create
            >>"ChangeProper ty" as a function and not as a sub? I see you are passing
            >>it some arguments. But what is the purpose of setting a return code
            >>value? Thanks, again.
            >>
            >>Sue
            >>
            >>*** Sent via Developersdex http://www.developersdex.com ***
            >>Don't just participate in USENET...get rewarded for it![/color]
            >
            >
            >[/color]

            Comment

            • Sue

              #7
              Re: Disabling the &lt;shift&gt ; + &lt;enter&gt ;


              MGFoster,

              Thanks for replying. I totally understand about function return codes
              (I've been programming for quite a few years). My question was not that
              clear ... it should have read ... Why use a function (and not a sub)
              with a return code if you are not going to test the return code? I
              don't believe that there was a test of the return code from
              ChangeProperty. Thanks.

              Sue


              *** Sent via Developersdex http://www.developersdex.com ***
              Don't just participate in USENET...get rewarded for it!

              Comment

              • Terry Kreft

                #8
                Re: Disabling the &lt;shift&gt ; + &lt;enter&gt ;

                As Mark said he's not a programmer and so maybe didn't realise why there was
                a return code there.

                As you know he could have done something like

                if Not ChangeProperty( "AllowBypassKey ", DB_Boolean, False) then
                Msgbox "Allow bypass key may still be enabled"
                end if


                Having said that the version on the Access Web posted earlier is better as
                it uses the DDL setting.


                --
                Terry Kreft
                MVP Microsoft Access


                "Sue" <slbrick56@yaho o.com> wrote in message
                news:4125fb52$0 $14478$c397aba@ news.newsgroups .ws...[color=blue]
                >
                > MGFoster,
                >
                > Thanks for replying. I totally understand about function return codes
                > (I've been programming for quite a few years). My question was not that
                > clear ... it should have read ... Why use a function (and not a sub)
                > with a return code if you are not going to test the return code? I
                > don't believe that there was a test of the return code from
                > ChangeProperty. Thanks.
                >
                > Sue
                >
                >
                > *** Sent via Developersdex http://www.developersdex.com ***
                > Don't just participate in USENET...get rewarded for it![/color]


                Comment

                Working...