User forms have a visual component and an associated code module that can be edited using the VBA IDE.
The code window is scrolled to show the code associated with the control you double-clicked. If no code is associated with the control, a function for the default event of the control is added.