Solved

Disable and Enable vbTABKEY in Access

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

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…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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.

786 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