Load a Form from String Variable 
Author Message
 Load a Form from String Variable

Is it possible to load a form using only the name of the form (as stored in
a string variable)?

For example:

strVariable = "frmMain"
Load strVariable

Any ideas?

Jim



Mon, 26 Mar 2001 03:00:00 GMT  
 Load a Form from String Variable
Hi

This is not possible, the way to do this is by a 'Select Case' or 'If ...
Then ...ElseIf' contruction

eg

Select Case strVariable
    Case "frmMain"
        frmMain.Show
    Case "frmOther"
End Select

If all the forms that you use are loaded you could experiment with the Forms
collection

You can do something like this; Forms(1).Show

Putting a string instead of a integer doesn't seem to work ...

bye

Quote:

>Is it possible to load a form using only the name of the form (as stored in
>a string variable)?

>For example:

>strVariable = "frmMain"
>Load strVariable

>Any ideas?

>Jim



Tue, 27 Mar 2001 03:00:00 GMT  
 Load a Form from String Variable

Try this:

 Dim variable As Form
 Set variable = frmMain
 Load variable



Mon, 23 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need to load a form using string variable as reference

2. Loading a form from string variable

3. Loading a form from string variable

4. How to Load a form using String variables

5. ???????? GURUS - Showing or Loading Forms by use of String variable containing Form Name

6. Hiow to Load a form using a string variable

7. Forms Collection: Using it to Open Forms by Passing the Form Name as a String Variable

8. Memory constraint loading a String Variable

9. Getting a reference to a loaded object from a string variable

10. How to load a show from a string variable

11. UserControl and Loading a Form from a variable

12. Load/Unload form with variable

 

 
Powered by phpBB® Forum Software