LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default test for key press


I have a VBA routine that runs queries in a database
application (QMF) and brings the results of all the
queries back into Excel and processes them. There is no
way of knowing when the queries are finished so the
routine uses Application.Wait to allocate enough time for
the query to run before transfering the data.

A user though is able to see when it's finished and could
press a key (e.g {End}) to tell the routine it can run the
transfer so hurrying the process up. How can I get this
to work? I tried using OnKey and a public variable but
this didn't seem to work and it's inefficient anyway; all
I need is to know at the point in time of the waiting if
the key is pressed. The wait routine would become:

Sub PauseRoutine(pause) (pause = number of seconds)
Dim i As Integer
For i = 1 To pause
Application.Wait Now + TimeValue("00:00:01")
If [end key is pressed] Then i = pause
Next i
End Sub

Any help appreciated.

Thx, Rob
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find&press button Alex New Users to Excel 1 February 18th 10 03:39 PM
when i press TAB key in an excel sheet nothing happens? max power Excel Discussion (Misc queries) 3 March 24th 08 09:49 PM
Calculate mean of test scores from rows of test answers RiotLoadTime Excel Discussion (Misc queries) 1 July 26th 06 05:14 PM
Information hidden when I press F2 Gazzr Excel Discussion (Misc queries) 1 April 20th 06 02:24 PM
When I Press the Enter Key Nothing happens. bigev Excel Discussion (Misc queries) 1 March 1st 06 03:05 PM


All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"