How to create/add code at run time and be able to save to the project?

Posted on 2007-10-07
Last Modified: 2010-04-23

I have heard about creating/add code at run time.

My question:

1. How to do it?
2. At what situation will be needed.
3. Could it save to the project after it is executed.
4. Could we also delete procedure at runtime, logically is could be if we could add code to it.

Suppose I want to create controls at runtime, at run time after the "Create_Control" procedure is called, I want to delete then "Create_Control" procedure. But I still want all the controls I created still exist on that form after the form is close from running.

Thank you.

Question by:emi_sastra
    LVL 22

    Expert Comment

    Take a look at these

    I really can't think of a use for it, I had a colleague use it once, but the doco is incomplete, and it took a lot of time to get it going.

    You will not be able to save the project after
    LVL 1

    Author Comment


    I don't understand the info of the link.

    Thank you.
    LVL 22

    Accepted Solution

    ok take a look at this one, it is well explained

    Download the source example too, and give that a try
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now