Solved

Disable and Enable vbTABKEY in Access

Posted on 2014-02-25
2
271 Views
Last Modified: 2014-02-25
I am trying to control the use of the TAB key in my form.  I am able to disable using:

Select Case KeyCode
        Case vbKeyTab
            KeyCode = 0
    End Select

but do not know how to enable it again.  Any idea what I set the value at?  I tried 1 and -1 but it didn't work

Thanks
0
Comment
Question by:marku24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 255 total points
ID: 39886072
You're disabling it via code ... the only way to enable it is to comment out that code:

Select Case KeyCode
        Case vbKeyTab
           ' KeyCode = 0
    End Select

Note the ' I placed in from of "KeyCode = 0". This marks the line as a comment, and VBA won't run it.

If you need to selectively disable it, you'd have to include some sort of interface item the code can reference. For example, you could include a Check box named "chkDisableTab", and then do this:

If chkDisableTab Then
  Select Case KeyCode
        Case vbKeyTab
            KeyCode = 0
   End Select
End If

Open in new window


This way, the code will only run if ckDisableTab = True.
0
 

Author Closing Comment

by:marku24
ID: 39886091
exactly what i needed.  thank you
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question