Solved

How to trap TAB keystroke

Posted on 1998-11-17
4
560 Views
Last Modified: 2011-09-20
How do I trap the TAb keystroke?  The KeyDown event doesn't recognize vbKeyTab and KeyPress doesn't recognize KeyAscii = 9.
0
Comment
Question by:craigdawson
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
vikiing earned 50 total points
Comment Utility
You have to use KeyPress() event, not KeyDown.

0
 

Author Comment

by:craigdawson
Comment Utility
I tried that without success.  Do you have a snippet of working code?
0
 
LVL 3

Expert Comment

by:vikiing
Comment Utility
This silly code will put at screen ASCII codes of the keys you type. And you can see the 9 for the TAB key:

Private Sub Form_KeyPress(K%)
Form1.Visible = True
Form1.AutoRedraw = True
?K%;
End Sub

0
 

Expert Comment

by:ratsifa
Comment Utility
You may should set the KEYPREVIEW = True for the Form load event.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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

9 Experts available now in Live!

Get 1:1 Help Now