Same Code under several Command buttons on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have written a loop routine that provides a running total in a table. I
need to attach this to several command buutons in a form. How do I set this
up as a sub-routine that I can call into the code for each button?
 
If all of the buttons are on the same form, you can simply put the code as a
function (not a sub!) in the code-behind-form module, then in the
appropriate event property for the buttons, put the name of the function.

If you need to know which button was clicked, you can use
Screen.ActiveControl.
 
Back
Top