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!

Dynamically Creating a Procedure

Status
Not open for further replies.

shetzel

Programmer
Jul 28, 2003
4
US
OK.. I was able to get the previous post resolved successfully. (Thanks!)

Now I've got another doozy of a question. Is there a way to dynamically create sub-procedures?

Here's the scenario... I'm attempting to create a scalable database, where fields/controls can be added/deleted at will, and still preform it's functions. What I want the code to do is upon creation of control X, create the on-change function of control X.

Example:

Private Sub X_Change()
Call ColorsUpdate
End Sub

Everything in the function stays the same with the exception of the control name. X needs to be replaced with whatever the new control is called, and this needs to happen everytime a new control is added.

Can this be done? Thanks for all your help! :)
 
I'm not sure why you'd want to do all this, but...change ColorsUpdate to a function and put =ColorsUpdate() in the little box next to the change event of the existing control, and make a new control by copying the existing one. That way it will run the function without having to build any code.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Professional Development for Clients Large and Small

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top