Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you create Global Procedures to use across Modules

Status
Not open for further replies.

lj50v

Programmer
Sep 21, 2008
6
AU
I want to be able to utilise a procedure across multiple form modules, but find that when I try this, there is no way the procedure is recognised in other sections of the code within the pjoject. Can this be done or is it a limitation of VBA?

Many thanx
 
You can use standard module. A form is a class, so a procedure in it can be considered as method, can be applied to instantiated object.

combo
 
Read up on Scope. This is a crucial concept to understand.
Can this be done or is it a limitation of VBA?
Yes, it can be done. It is done exactly as combo states. Use a standard module.

Essentially, procedures in a form module are in Scope only in that module.

Procedures in a standard module are in Scope in the project.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top