A good beginning example of code run from a button is made
for you if you use the button wizard to create a command
button to close the form containing that button or to open
another form.
If you have created your vba code in modules as functions
you can use Call or just put the function name in code on a
button's on click event.
Access is an event driven environment. You use events like
clicking a button, a form closing or opening, the cursor
leaving a control and so on to trigger your pieces of code.
I beleive there is a section in the Access/VBA help which
describes the process of creating code for events.