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
|