Solved

How to trap TAB keystroke

Posted on 1998-11-17
4
561 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
ID: 1445313
You have to use KeyPress() event, not KeyDown.

0
 

Author Comment

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

Expert Comment

by:vikiing
ID: 1445315
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
ID: 1445316
You may should set the KEYPREVIEW = True for the Form load event.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code 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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

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