Solved

Simulating the ESC Key.

Posted on 1999-01-11
2
381 Views
Last Modified: 2006-11-17
Hi.  I'm using some Visual Basic code in Access, and I want to use code to simulate the same effect as the user pressing the Esc key.  Maybe I should post this in the access section, but as I say, it's VB code.

When I start to edit a record on a form, and then change my mind, I have to hit ESC to cancel the half entered record.  I simply want to be able to have the code execute this without the user pressing the key.  

I know the KeyAscii for ESC is 27.  Can I somehow use this to tell the computer to "Press Key 27?"

Thanks for any help.

TISS
0
Comment
Question by:TISS
[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 Comments
 
LVL 14

Accepted Solution

by:
waty earned 40 total points
ID: 1455342
use the sendkeys function :

sendkeys "{esc}"

0
 

Author Comment

by:TISS
ID: 1455343
Just what I'm looking for.  Thanks.

0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month7 days, 22 hours left to enroll

617 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