Solved

How to trap TAB keystroke

Posted on 1998-11-17
4
564 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON Response and request in VB6 application 11 1,082
Spell Check in VB6 13 152
Send outlook email from VBS Script 2 67
Publisher:   Unknown     VB.exe Application 1 32
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

710 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