When you are in Design mode, you write even handlers for your controls.
For example, you have a CommandButton Command1, and you can add the following event handler:
Private Sub Command1_Click()
' Now in this event handler
' you KNOW you are writing code that is expected to
' be executed after the user clicks Command1
End Sub