To add VB code to a button you must first use screen4 to make it a VB button. Then open the screen, use the menu bar, operator, then Edit Button Script. All the buttons that are defined as Vb will blink, click the one you want to edit. An editor window will open.
see the VB topic in this forum for examples of button code.