G
Guest
If I have a name of a User Control in my project, how can I set an Object to
that User Control?
ie;
I have a User Control, called "Accounts" in my project
I tried the following code
strUserControlName = "Accounts"
frmMain.Controls.Add(strUserControlName)
But, of course, the above code doesn't work, because the second line of code
wants a User Control parameter, not a string parameter.
so, I need to do something like this:
dim objUserControl as UserControl
set objUserControl = UserControl(strUserControlName)
How do I do this? Your help would be appreciated.
Dave
that User Control?
ie;
I have a User Control, called "Accounts" in my project
I tried the following code
strUserControlName = "Accounts"
frmMain.Controls.Add(strUserControlName)
But, of course, the above code doesn't work, because the second line of code
wants a User Control parameter, not a string parameter.
so, I need to do something like this:
dim objUserControl as UserControl
set objUserControl = UserControl(strUserControlName)
How do I do this? Your help would be appreciated.
Dave