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

Calling a function using a string

Status
Not open for further replies.

npongar

Programmer
Oct 3, 2003
12
CA
Hey everyone,

Lets say I have a large number of text boxes on a form. Each has a unique name, and for each there is a function with the same name in a module. When the form is processed, the function corresponding to a text box is only called if the text box is non-empty. Currently, I have a giant if-else structure for calling these functions. This is a huge pain if I want to add a function. Is there a way to simply take the name of a textbox, as a string, and call the function indirectly?

This is what I want to do:

For each control in myform
if(it is a text box)then
grab name
call function
endif
next


Can this be done?
 
Nevermind, found the answer in another post. (use the run function)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top