PDA

Click to See Complete Forum and Search --> : help...get an object with a string


bilko73
Sep 20th, 2002, 10:26 AM
I have the following code in a form:
WithEvents cmd_inorg_clp_11and12 As New Button()
WithEvents chk_inorg_clp_11and12 As New CheckBox()

along with many more

is there a way to assign an object to one of these using a string by the same name?

I want to:

dim ctl as object
ctl = cmd_inorg_clp_11and12

using a string by the same name ("cmd_inorg_clp_11and12")
retrieved from reading a table

in other words I need to add a control to a form based on their names in a table.

thanks

PT Exorcist
Sep 20th, 2002, 10:34 AM
use a if statement or select case...