Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2005
    Posts
    196

    Unanswered: AllowSpecialkeys in VB Code

    I want to disable the F11 key in VB code - the reason why is so I can stop admin users from using the F11 method.

    First of all I tried
    Code:
    AllowSpecialKeys=False
    but that came up as variable not defined. The access help says I need to create the property - how would I do that/

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Why do you want to do this in VB code?
    I ran your above code behind the click event of a button with no errors (I'm using Access 2003) - I suggest you create a command button and simply stick that line behind and see if the error still occurs.

    You can disable Access Special Keys by going to "Tools > Startup..."
    George
    Home | Blog

  3. #3
    Join Date
    Aug 2005
    Posts
    196
    Quote Originally Posted by georgev
    Why do you want to do this in VB code?
    I ran your above code behind the click event of a button with no errors (I'm using Access 2003) - I suggest you create a command button and simply stick that line behind and see if the error still occurs.

    You can disable Access Special Keys by going to "Tools > Startup..."
    I want to run it so that users in the Admin group cannot press F11 to view the database window. It gives a compile error "Variable Not Defined" When I run it - also using Access 2003 but file format is Access 2000.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    It doesn't seem like there's much need for this to be done in code, however, I have 2 solutions
    1)
    Quote Originally Posted by georgev
    You can disable Access Special Keys by going to "Tools > Startup..."
    2) Create an AutoKeys macro

    Both fairly simple - option 1 is the easiest of all!
    George
    Home | Blog

  5. #5
    Join Date
    Aug 2005
    Posts
    196
    Quote Originally Posted by georgev
    It doesn't seem like there's much need for this to be done in code, however, I have 2 solutions
    1)
    2) Create an AutoKeys macro

    Both fairly simple - option 1 is the easiest of all!
    So you type {F11} in the Macro name, but what would you do in the action to stop it from going into the database window?

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Well, I believe by simply creating an AutoKeys macro, you disable access special keys... Try it?
    George
    Home | Blog

  7. #7
    Join Date
    Aug 2005
    Posts
    196
    It does - the problem with this method is I can't switch it back on if the user is in a specific group. I would just disable it in the Startup menu, but I want one user group to be able to use it and another to not be able to use it. many thanks for all your replies.

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Hmm, well I had a problem similar to this before - and I believe the answer was: "it's a startup property so will only be applied on restart of the application" - which isn't really secure, is it?
    George
    Home | Blog

Posting Permissions

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