I have an Array named Menus. It contains a form name per element.
How can I call them dynamically?
For example, if Menus(1) = “Login”, and Menus(2) = “Logout” I need to say
Login.Show
but I want to do this using the Array name. I clearly can’t do this:
Menus(X).Show
Is this possible in VB or is there a way around this?
Thanks in advance!
What you’re essentially trying to do is use a form’s name to instantiate and load a form.
One way to do this is to pass a string with your form’s name to the Form
Collection‘sAddfunction:Or, using VB6’s CallByName Function: