assign code to a button

  • Thread starter Thread starter Rpettis31
  • Start date Start date
Click on the Properties button

Click on your Button

Click on the Events tab in Properties.

The usual one you will want for a button is the On Click Event
Click next to that and choose Event procedure. Click just right of that and
open a Code Module.
Type your code just above the bit the says
End Sub

Best of luck!
Evi
 
How do I assign the vba code to a button on a form?

Thanks

Display the Form's property sheet.
Click on the Event tab.
Click on the event line you wish to code.
Write
[Event Procedure]
on that line.
Then click on the little button with the 3 dots that appears on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those lines write your code.
 
Back
Top