Solved

Disable and Enable vbTABKEY in Access

Posted on 2014-02-25
2
270 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 84

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

732 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