Simply set the KeyPreview property of the form to True and add the following code:
Best regardsCode:Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) 'prevent the ALT+F4 keystokes If Shift = vbAltMask And KeyCode = vbKeyF4 Then KeyCode = 0 End If End Sub




Reply With Quote