Gustavo

Gustavo

  • NA
  • 1.3k
  • 453.8k

Use a text field to open a form by that name

Feb 17 2010 11:11 AM

Hello:
I have posted a bit different version of this question. But, now I want to ask it differently and maybe get my question across.
I have a text field from my TreeView and would like to have it passed to the program and have it open the form with the same name. I don't want to have a bunch of if/else statements for each possibility.
Example: If a text field is entered and its 'Customer' I want to pass that string/text to a routine that will open the 'FormCustomer'. Below is some pseudo code.
 
e.Node.Name = "Customer"
//FormToOpen FormToOpen = e.Node.Name;
//frm.MdiParent = this;
//FormToOpen.Show();
 
Hope I explained it a bit better.

Answers (14)