General i write the code in a Module when i use the same code from other forms in the same program.

I hope that helps you.