By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,080 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,080 IT Pros & Developers. It's quick & easy.

Ctrl + Break

P: n/a
How to block Crtl + Break keys if any Error or MsgBox shows ???

I tryed with this code buy it looks it does not work.

Private Sub Form_KeyPress(KeyAscii As Integer)
If Chr$(&H4) + Chr$(70) Then 'CTRL-BREAK
MsgBox "No valid option"
docmd.cancel
End If
End Sub

Can anybody help me ?
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rather then using MsgBox, why not use your own form to display whatever
information that is currently on the MsgBox?

Nov 13 '05 #2

P: n/a
"Javier Gomez" <ja*****************@gmail.com> wrote in message
news:89**************************@posting.google.c om...
How to block Crtl + Break keys if any Error or MsgBox shows ???

I tryed with this code buy it looks it does not work.

Private Sub Form_KeyPress(KeyAscii As Integer)
If Chr$(&H4) + Chr$(70) Then 'CTRL-BREAK
MsgBox "No valid option"
docmd.cancel
End If
End Sub

Can anybody help me ?


Certainly you could use Chuck's suggestion of avoiding the message box
altogether, but perhaps you should explain why you need this. If you need
to prevent people seeing/editing the code then you could use a compiled mde
file which makes this impossible. If you are trying to keep out the mildly
curious amateur then you could simple select Tools>Startup and not allow
Access special keys, although this would not be as secure as the first
suggestion.
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.