opening a form from db...

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hello,

I have an app that utilizes approx 15 different forms to gather user
input. These forms will be customized for each different group of
users. Currently, to allow the user to select the appropriate form, I
am loading the form name into a listbox (collection property) and when
they double-click on a name, using a select-case statement to
instantiate and open the appropriate form.
However, I would like to be able to perform this task a little more
dynamically. For example, I would like to create a db table with a
fld for the form description and a fld for the actual form name and
set the description as the listbox display member and the form name as
the value member:
form_desc | form_name
medical info | med_info.vb
ins info | ins_info.vb
etc...............

When the user double-clicks an item in the listbox, I could open the
form associated with it. But, my problem is: How do I open a new form
based on a string from the db???
Dim myForm as new myRead("form_name") ??????
Dim myForm as new strForm_Name ?????

I hope I have explained this clearly enough!!!
Thanks!!

Frank
 
Frank said:
Hello,

I have an app that utilizes approx 15 different forms to gather user
input. These forms will be customized for each different group of
users. Currently, to allow the user to select the appropriate form, I
am loading the form name into a listbox (collection property) and when
they double-click on a name, using a select-case statement to
instantiate and open the appropriate form.
However, I would like to be able to perform this task a little more
dynamically. For example, I would like to create a db table with a
fld for the form description and a fld for the actual form name and
set the description as the listbox display member and the form name as
the value member:
form_desc | form_name
medical info | med_info.vb
ins info | ins_info.vb
etc...............

When the user double-clicks an item in the listbox, I could open the
form associated with it. But, my problem is: How do I open a new form
based on a string from the db???
Dim myForm as new myRead("form_name") ??????
Dim myForm as new strForm_Name ?????

I hope I have explained this clearly enough!!!

Yes. The filename does not matter, but the class name does. If you store the
class name in the database, you can use System.Activator.CreateInstance to
create a new instance from the string containing the class name.


Armin
 
Yes. The filename does not matter, but the class name does. If you store the
class name in the database, you can use System.Activator.CreateInstance to
create a new instance from the string containing the class name.


Armin

Armin,

Sorry about the delay in responding. Followed you advice and it
performs wonderfully! I am in multi form heaven!


Thanks for the help!

Frank
 
Frank said:
Armin,

Sorry about the delay in responding. Followed you advice and it
performs wonderfully! I am in multi form heaven!


Thanks for the help!


you're welcome! :-)


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top