Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to trap TAB keystroke

Posted on 1998-11-17
4
Medium Priority
?
568 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
[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
4 Comments
 
LVL 3

Accepted Solution

by:
vikiing earned 100 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

688 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