You mean this...???
Code:
Option Explicit

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
   Debug.Print "Before"
   MsgBox "Hello"      '~~~> Display a message box
   Debug.Print "After" '~~~> Works only after the Msgbox is closed (or OK button is pressed)
End Sub