Results 1 to 4 of 4
  1. #1
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118

    Error when Disabling Special Keys

    Hi, folks. I'm trying to disable special keys in my database, like F11. But when I try to run the vba code, I get "Run-time Error '3270': Property Not Found."

    Here's the code I'm using:



    Code:
    CurrentDb.Properties("AllowSpecialKeys") = False
    I also tried this:

    Code:
    CurrentDb.Properties("AllowSpecialKeys").Value = False
    ...but that didn't work either.

    Any idea what's wrong? Thanks for your help.

    Matt

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    This could be one of those properties that do not automatically exist (such as AllowByPassKey) and have to be added first, then assigned. The error is typically handled by directing flow to a small sub that adds the property desired, then Resumes (so that the failed line runs again) thus the value is then assigned to the now existing property. Once created, the code will simply set the property as directed. You might want to have a hidden way of flipping any db property you set, such as a double click event on an About form label. For the F11 thing, I've never used it, just relied on setting the property in options.
    Last edited by Micron; 07-30-2016 at 10:17 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118
    Thanks! That worked. I found some helpful code for it at this link: http://icodeguru.com/database/Progra...l/LiB0058.html

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You're welcome.
    Lots of info there. As I mentioned, you should provide a means for cycling the AllowBypassKey should you code this to be false, lest you (potentially) lock yourself out of the db.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 03-23-2016, 07:26 PM
  2. Disabling keys and hot keys
    By data808 in forum Access
    Replies: 3
    Last Post: 07-11-2014, 05:21 PM
  3. Special Reports
    By Edwin221 in forum Reports
    Replies: 0
    Last Post: 08-23-2013, 04:38 PM
  4. Alter Special Keys Dynamically
    By EddieN1 in forum Security
    Replies: 1
    Last Post: 02-16-2012, 03:03 PM
  5. Special Characters
    By orgelizer in forum Access
    Replies: 0
    Last Post: 03-20-2007, 08:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums