Computing.Net > Forums > Programming > KeyPress (VBA)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

KeyPress (VBA)

Reply to Message Icon

Name: Kevin
Date: December 19, 2002 at 06:59:43 Pacific
OS: 2000
CPU/Ram: enough
Comment:

I have multiple forms in a project and what I would like to do is hit the Escape key on every form and the form hides. What code would I use to do this and where can I set it so that I dont have to do this code on every form.



Sponsored Link
Ads by Google

Response Number 1
Name: Madman
Date: December 19, 2002 at 11:42:51 Pacific
Reply:

What do you mean by 'hides'...like, be invisible? You could do it but you would have to have some code in each form to trigger the event. Question...how are you going to 'unhide' the forms?


0

Response Number 2
Name: cykage
Date: December 20, 2002 at 20:23:04 Pacific
Reply:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyEscape
Form1.Hide
End Select
End Sub

put that code in each form


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: KeyPress (VBA)

VBA math function for time dilation www.computing.net/answers/programming/vba-math-function-for-time-dilation/6177.html

VBA help with input and msgbox plz www.computing.net/answers/programming/vba-help-with-input-and-msgbox-plz/13128.html

Excel VBA Problem saving file www.computing.net/answers/programming/excel-vba-problem-saving-file-/14722.html