The method of writing code for a menu item is same as for other controls.
Click the menu item in the form under design. This opens the menu item’s event handler, like this:
Private Sub mnuFile New-Click ()
Add the code of which will execute when the user will choose this menu item to the event handler procedure.