Solved

KeyCode

Posted on 2000-04-18
6
376 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Accepted Solution

by:
Sage020999 earned 10 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
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…
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…

920 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

15 Experts available now in Live!

Get 1:1 Help Now