same button on multiple pages

  • Thread starter Thread starter Robin
  • Start date Start date
R

Robin

Hi
I have a multipage form and I would like to know if it's possible to link
the "on click" code to similar buttons on the different pages. For example,
on each form, I have a NEXT button which takes you to the next page. I would
like to know if the same code can be assigned to each NEXT button, instead of
having many different CommandButtonxx_click codes. It would be great to just
refer each button to say a cbNext_click() code.
Thanks!
 
You need to have one macro for each button. but you can combine the code if
you are smart

Private Sub CommandButton1_Click()
call Commonbutton()
End Sub

Private Sub CommandButton1_Click()
call Commonbutton()

End Sub

Private Sub CommandButton1_Click()
call Commonbutton()

End Sub

'put into a module
Sub Commonbutton()

'put common code here
exit Sub
 
Hi
I have a multipage form and I would like to know if it's possible to link
the "on click" code to similar buttons on the different pages. For example,
on each form, I have a NEXT button which takes you to the next page. I would
like to know if the same code can be assigned to each NEXT button, instead of
having many different CommandButtonxx_click codes. It would be great to just
refer each button to say a cbNext_click() code.
Thanks!
 
Back
Top