Solved

Disable and Enable vbTABKEY in Access

Posted on 2014-02-25
2
255 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
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 255 total points
Comment Utility
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
Comment Utility
exactly what i needed.  thank you
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now