???????? GURUS - Showing or Loading Forms by use of String variable containing Form Name 
Author Message
 ???????? GURUS - Showing or Loading Forms by use of String variable containing Form Name

In Access you can open a Form by using a String variable that contains
the Form Name. The basic syntax is as follows:

        DoCmd.OpenForm formname

where formname is a String expression.

Can string variables be used in a similar manner in VB5?

TIA, Regards, Michael.



Mon, 31 Jan 2000 03:00:00 GMT  
 ???????? GURUS - Showing or Loading Forms by use of String variable containing Form Name

You could possibly use VB's forms collection like this:

          Forms("frmNameHere").Visible=True

I haven't tested it since this machine does not have VB installed.
My guess is the form must already be loaded (so that it is already
a member of the forms collection) and hidden.  Try it out.

Ho

Quote:

> In Access you can open a Form by using a String variable that contains
> the Form Name. The basic syntax is as follows:

>         DoCmd.OpenForm formname

> where formname is a String expression.

> Can string variables be used in a similar manner in VB5?

> TIA, Regards, Michael.



Mon, 31 Jan 2000 03:00:00 GMT  
 ???????? GURUS - Showing or Loading Forms by use of String variable containing Form Name

Quote:

>In Access you can open a Form by using a String variable that contains
>the Form Name. The basic syntax is as follows:

>    DoCmd.OpenForm formname

>where formname is a String expression.

>Can string variables be used in a similar manner in VB5?

P.S.  I want to show unloaded forms!!
Quote:

>TIA, Regards, Michael.



Tue, 01 Feb 2000 03:00:00 GMT  
 ???????? GURUS - Showing or Loading Forms by use of String variable containing Form Name

I'd like to know the answer to this one also. Anybody out there know it??
This could save alot of resources for me if I could use the form strings
when I need them.

Thanks,
Craig Johnson



Quote:
> In Access you can open a Form by using a String variable that contains
> the Form Name. The basic syntax is as follows:

>    DoCmd.OpenForm formname

> where formname is a String expression.

> Can string variables be used in a similar manner in VB5?

> TIA, Regards, Michael.



Fri, 04 Feb 2000 03:00:00 GMT  
 ???????? GURUS - Showing or Loading Forms by use of String variable containing Form Name


Quote:

>I'd like to know the answer to this one also. Anybody out there know it??
>This could save alot of resources for me if I could use the form strings
>when I need them.

>Thanks,
>Craig Johnson



>> In Access you can open a Form by using a String variable that contains
>> the Form Name. The basic syntax is as follows:

>>       DoCmd.OpenForm formname

>> where formname is a String expression.

>> Can string variables be used in a similar manner in VB5?

>> TIA, Regards, Michael.

This is a kluge, but if the form is loaded, you can loop through the forms
collection, comparing the current Form.Name to the value in the variable, then
showing it when true.

This worked in a little test I ran.

R,
Mike



Fri, 04 Feb 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

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

2. Hiow to Load a form using a string variable

3. How to Load a form using String variables

4. opening a form using a string containing form name

5. Load form when name contained in a string.

6. How to load a show from a string variable

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

8. Showing VB Forms via string variable

9. How to show a form from a string variable

10. Loading a form from string variable

11. Loading a form from string variable

12. Load a Form from String Variable

 

 
Powered by phpBB® Forum Software