Link to home
Start Free TrialLog in
Avatar of Moother
Moother

asked on

Blocking CTRL-F4


Hello Smart Folk,

Anyone got a code snippet that will stop my users being able to close a form with CTRL-F4?

Thanks,

M
ASKER CERTIFIED SOLUTION
Avatar of Data-Man
Data-Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Moother
Moother

ASKER

any idea how to do that so my pc will understand it?

I know the principle..., but lack the talent...
Put this code inside the keydown event for the form.

Also set the key preview property to yes.


If (Shift And acCtrlMask) > 0 And KeyCode = vbKeyF4 Then
    KeyCode = 0
End If

Mike
Avatar of Moother

ASKER

worth a A grade!!!

thanks a million!
too bad it wasn't worth a million....LOL...Mike