First make sure to set child forms KeyPreview property to TRUE. This will ensure that your Esc key event will be captured by the form.
In the MDI form write something like:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim oFrm As *child_form_name, for exmple Form2*
If KeyCode = vbKeyFx (where x is a numer from 1 to 12) then
Set oFrm = New Form2 '...(actualy *child_form_name*)...
'...If you unload the form from within it self then you don't need this line, but if you just Hide it then you must:
'...Finaly release the object...
The Escape key press code stated above is correct except that it is general better idea to unload the form in the calling process.
You can also use vbKeyEscape constant instead of 27.
I want to know the code for the functions keys as a command for my program (Student Details)..F1 as Add, F2 as Edit, F3 as Save, F4 as Cancel, Del for Delete and Esc as Exit..and a code for running my program on other PC.
Thanks a lot!! :)
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...