473,382 Members | 1,247 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to trap the ESC key programmatically

How do I trap the ESC key in VB code. I am generating reports in Access and I want to check whether the user wants to abort lengthy report.

Thanks
Claude
Jun 29 '07 #1
5 2254
debasisdas
8,127 Expert 4TB
try to handle

KeyCode = vbKeyEscape or KeyCode=27

in keydown event
Jun 29 '07 #2
try this:

e.keycode=keys.ESC

put the code in the keydown event of the control
Jun 29 '07 #3
try to handle

KeyCode = vbKeyEscape or KeyCode=27

in keydown event
Thank guys. But I am doing the report generation in the event handler of the OnClick event of a command button. Can I check whether a Keypress has occurred in the event handler?
Thanks
Jun 29 '07 #4
debasisdas
8,127 Expert 4TB
set the KEYPREVIEW property of the form to true.
Jul 4 '07 #5
set the KEYPREVIEW property of the form to true.
Thanks Debasisdas. Your suggestion enables the keydown events of the form b ut while I am in the event handler of the command button the forms OnKeypress event does not get called.
Jul 12 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Mike D | last post by:
I have a table in SQL 2000 with a composite Primary Key on coulumns Instrument_ID (int) and WeekOf (smalldatetime.) I am running asp on win 2003. I insert values using a stored procedure from...
2
by: aj | last post by:
DB2 WSE LUW 8.1 Fixpak 5 Red Hat AS 2.1 Has anyone ever seen a db2diag.log indicate that a trap file was written, but it is *not* written? For the 3rd time in 18 months, I had a production...
5
by: Carlo Marchesoni | last post by:
From an aspx page (A.aspx) I open another one (B.aspx - for table lookup). When the user selects an entry in B.aspx I would like to force a button's event in A.aspx to be fired. I guess the only...
11
by: pemo | last post by:
Ambiguous? I have a student who's asked me to explain the following std text (esp. the footnote). 6.2.6.1.5 Certain object representations need not represent a value of the object type. If...
2
by: ramu | last post by:
Hi, I read the phrase " trap representation" in the topic "Union arrangement" in this group. Can you please tell me what do you mean by it? regards
10
by: pemo | last post by:
As far as I understand it, a trap representation means something like - an uninitialised automatic variable might /implicitly/ hold a bit-pattern that, if read, *might* cause a 'trap' (I'm not...
10
by: john | last post by:
In a form I'm trying to make a search field to be able to quickly find a record on ID-number. User enters a number and presses enter to move to that record. How do I trap for the enter-keystroke...
3
by: Ken Fine | last post by:
I'm interested in programmatically manipulating groups of ASP.NET controls by type. Can someone suggest code for the following? Loop through, say, all label controls on a page, and assigning a...
6
by: temper3243 | last post by:
Hi Can someone explain me what is happening below ? Why is it printing 401380 $ cat scanf.c #include<stdio.h> int main() { int i; scanf(" %d",&i);
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.