In addition to Ranmans suggestions for storing globally used functions, If the code you refer to is very form specific you can create a Private Sub in the forms code module, and call it repeatedly whenever you need it rather than repeating it. e.g. lets say you needed something like this very simplified example to run on lots of different events;
Code:
Private Sub SetButtonsUp()
Me.txtBox1.Visible = False
Me.txtBox2.Visible = False
Me.txtBox3.Visible = True
Me.txtBox4.Visible = True
End Sub
Then simply in all the places you want to use it on the form ;