Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

KeyCode

Posted on 2000-04-18
6
Medium Priority
?
384 Views
Last Modified: 2012-05-04
Is there a way to find the KeyCode when we don't know where is the focus. I don't want to use SetFocus. I just want to catch the KeyCode Anytime.
If it is possible without Api i'd like?
0
Comment
Question by:dosyl
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:Sage020999
ID: 2728419
Are you talking about monitoring which keys are pressed in your app?  You can turn on the keypreview for the form.  
0
 
LVL 1

Author Comment

by:dosyl
ID: 2728560
I want to verify for example:
If the user press Delete, i will delete the info. on the form. Etc.
0
 
LVL 1

Author Comment

by:dosyl
ID: 2728567
Info.= Data in txtboxes, data in the recordset etc.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Accepted Solution

by:
Sage020999 earned 40 total points
ID: 2728604
Ok,  turn on your keypreview for the form.  This will send the keypreview property of the form.  This will force the keys to affect the form and not the controls on the form.  You can then validate the keys in the Keyup or Keydown events to involk the differant responses you wish to create.
0
 

Expert Comment

by:korky
ID: 2730719
Use the GetAsyncKeyState() API


0
 
LVL 1

Author Comment

by:dosyl
ID: 2730821
I forgot this property.
Thank you.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…

886 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