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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code Modules

Status
Not open for further replies.

user101

Technical User
May 30, 2003
6
AU
I have a program with class module, 2 forms and a code module.

How do i refer to the functions within the code module from one of the forms?

eg. when ok is clicked on the first form I want a function in the code module to execute. anyone know how to do this?
 
Declare the function in the code module as Public:

Public function DoSomething() as string
DoSomething = "You mean like this"
End Function


Then just call the function

msgbox DoSomething

"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top