PC Review


Reply
Thread Tools Rate Thread

Disable ESC or CTRL+BREAK

 
 
Dave
Guest
Posts: n/a
 
      11th Oct 2004
I have a subroutine that imports a very large text file, which is
fairly time consuming, then runs three quick queries afterward. On the
form where the command button to run this subroutine exists, I do
inform the users that if they can't wait for the import to finish, to
press the ESC key. The import takes up 99% of the time for this
subroutine to finish. I do not want the user to accidently press the
ESC key however, when the three quick queries are being executed at
the end of the sub routine (about 5 seconds each). Is there a way to
just disable ESC or CRTL+BREAK after the import, but before the three
queries execute, then enable ESC and CRTL+BREAK again after the three
queries are executed, or at least after the subroutine is finished?

Thanks,

Dave
 
Reply With Quote
 
 
 
 
solex
Guest
Posts: n/a
 
      11th Oct 2004
Dave,

You can go to the menu \\Tools\Startup (Access 2K) and uncheck "Use Access
Special Keys" in the Advanced Section. This disables the use of CTRL+BREAK.
Also I would consider uploading the data to temporary table before importing
to the production tables for saftey reasons.
Dan

Assuming your import screen is a modal dialog box, you can set key preview
in the
"Dave" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a subroutine that imports a very large text file, which is
> fairly time consuming, then runs three quick queries afterward. On the
> form where the command button to run this subroutine exists, I do
> inform the users that if they can't wait for the import to finish, to
> press the ESC key. The import takes up 99% of the time for this
> subroutine to finish. I do not want the user to accidently press the
> ESC key however, when the three quick queries are being executed at
> the end of the sub routine (about 5 seconds each). Is there a way to
> just disable ESC or CRTL+BREAK after the import, but before the three
> queries execute, then enable ESC and CRTL+BREAK again after the three
> queries are executed, or at least after the subroutine is finished?
>
> Thanks,
>
> Dave



 
Reply With Quote
 
 
 
 
Alp
Guest
Posts: n/a
 
      12th Oct 2004
Hi Dave,

I'm no expert here but here's something I have put together but not tried
yet. If you feel like, then give it a try and do let me know pease.

I hope it will work for you.

Alp

Code below:
'Code by: M. Alp Bekisoglu
'Created: 12/10/2004
'Contents:___________
'DisabECB - Disables use of Esc and the Ctrl+Break keys
'EnabECB - Enables use of Esc and the Ctrl+Break keys
'
Private Function DisabECB()
'Disables Esc and Ctrl+Break keys
Dim db As DAO.Database
Dim P As Property
'Const conPrpNotFound = 3270

Set db = CurrentDb
'On Error GoTo conPrpNotFound

If IsError(db.Properties!AllowBreakIntoCode) = True Then
'if property is not found then create and set to False

prpnm = "AllowBreakIntoCode"
prptype = 1
prpvalue = 0
P = db.CreateProperty(prpnm, prptype, prpvalue)
db.Properties.Append P
Else
'if property is found then set to False

db.Properties(AllowBreakIntoCode) = 0
End If

If IsError(db.Properties!AllowSpecialKeys) = True Then
'if property is not found then create and set to False

prpnm = "AllowSpecialKeys"
prptype = 1
prpvalue = 0
P = db.CreateProperty(prpnm, prptype, prpvalue)
db.Properties.Append P
Else
'if property is found then set to False

db.Properties(AllowSpecialKeys) = 0
End If
Set db = Nothing
End Function

Private Function EnabECB()
'Enables Esc and Ctrl+Break keys
Dim db As DAO.Database
Dim P As Property
'Const conPrpNotFound = 3270

Set db = CurrentDb
'On Error GoTo conPrpNotFound

If IsError(db.Properties!AllowBreakIntoCode) = True Then
'if property is not found then create and set to True

prpnm = "AllowBreakIntoCode"
prptype = 1
prpvalue = -1
P = db.CreateProperty(prpnm, prptype, prpvalue)
db.Properties.Append P
Else
'if property is found then set to True

db.Properties(AllowBreakIntoCode) = -1
End If

If IsError(db.Properties!AllowSpecialKeys) = True Then
'if property is not found then create and set to True

prpnm = "AllowSpecialKeys"
prptype = 1
prpvalue = -1
P = db.CreateProperty(prpnm, prptype, prpvalue)
db.Properties.Append P
Else
'if property is found then set to True

db.Properties(AllowSpecialKeys) = -1
End If
Set db = Nothing
End Function

"Dave" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a subroutine that imports a very large text file, which is
> fairly time consuming, then runs three quick queries afterward. On the
> form where the command button to run this subroutine exists, I do
> inform the users that if they can't wait for the import to finish, to
> press the ESC key. The import takes up 99% of the time for this
> subroutine to finish. I do not want the user to accidently press the
> ESC key however, when the three quick queries are being executed at
> the end of the sub routine (about 5 seconds each). Is there a way to
> just disable ESC or CRTL+BREAK after the import, but before the three
> queries execute, then enable ESC and CRTL+BREAK again after the three
> queries are executed, or at least after the subroutine is finished?
>
> Thanks,
>
> Dave



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Esc Key =?Utf-8?B?UmlwcGVy?= Microsoft Access Forms 1 15th Oct 2004 05:20 PM
Disable the ESC key? Or recover the text that ESC deletes? fredo@simple-nude.com Windows XP Internet Explorer 0 3rd Aug 2004 11:58 AM
How to disable CTRL+ESC shortcut key belcon Windows XP Security 1 2nd Oct 2003 01:44 AM
Re: PPT 97 - Disable ESC Key TAJ Simmons Microsoft Powerpoint 1 23rd Sep 2003 06:48 PM
Disable the Alt+Tab,Alt+F4,ctr+Alt+Delete ,Alt+esc,Ctrl+Esc keys through C# program Joe Microsoft Dot NET Framework Forms 0 7th Aug 2003 10:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:13 PM.