How to load form using form name from field 
Author Message
 How to load form using form name from field

  how can i load a form using the form's name from a field in a table,
ie. using: 'Data1.Recordset![Form Name]'?

  Thanks.

--
                         * REDUCE, REUSE, RECYCLE *



Sun, 20 Feb 2000 03:00:00 GMT  
 How to load form using form name from field

:   how can i load a form using the form's name from a field in a table,
: ie. using: 'Data1.Recordset![Form Name]'?

  maybe i should rephrase:  how can i load forms using their names that i
have stored as strings in a database table?

  i've tried stuff like: Data1.Recordset![Form Name].Show and
Dim myform as Form
set myform = Data1.Recordset![Form Name]
myform.Show
...no luck.  

  i realize that the values i'm getting back from the table are of type
'String' but i have no idea how to cast it to be of type 'Form' so that i
can load the form which has a name property equal to the extracted value.

  please help, thanks a lot in advance.

--
                         * REDUCE, REUSE, RECYCLE *



Tue, 22 Feb 2000 03:00:00 GMT  
 How to load form using form name from field

We had a similar problem back in the good old VB3 days.  All we could do
then was have a big select case like

        select case strFormName
                case "Form1"
                        Form1.show

        etc.

You could load all your forms in a collection and set the key to be the
form name then you could access show it with:
        colForms(strFormName).show
But you would still have to previously load all the forms into the
collection by
        colForms.add form1
        colForms.add form2

etc.

Good luck
--
Shawn
--

http://www.cris.com/~shawnlee/    Borg Pursuit Screen Saver for Windoz



Quote:

> :   how can i load a form using the form's name from a field in a table,
> : ie. using: 'Data1.Recordset![Form Name]'?

>   maybe i should rephrase:  how can i load forms using their names that i
> have stored as strings in a database table?

>   i've tried stuff like: Data1.Recordset![Form Name].Show and
> Dim myform as Form
> set myform = Data1.Recordset![Form Name]
> myform.Show
> ...no luck.  

>   i realize that the values i'm getting back from the table are of type
> 'String' but i have no idea how to cast it to be of type 'Form' so that i
> can load the form which has a name property equal to the extracted value.

>   please help, thanks a lot in advance.

> --
>                          * REDUCE, REUSE, RECYCLE *



Fri, 25 Feb 2000 03:00:00 GMT  
 How to load form using form name from field

Quote:
>> :   how can i load a form using the form's name from a field in a table,
>> : ie. using: 'Data1.Recordset![Form Name]'?

>>   maybe i should rephrase:  how can i load forms using their names that i
>> have stored as strings in a database table?

>>   i've tried stuff like: Data1.Recordset![Form Name].Show and
>> Dim myform as Form
>> set myform = Data1.Recordset![Form Name]
>> myform.Show
>> ...no luck.  

>>   i realize that the values i'm getting back from the table are of type
>> 'String' but i have no idea how to cast it to be of type 'Form' so that i
>> can load the form which has a name property equal to the extracted value.

>>   please help, thanks a lot in advance.

>> --
>>                          * REDUCE, REUSE, RECYCLE *

how about something like:

dim mForm as Form

for each mForm in Forms
   if mForm.Name = Data1.Recordset[Form Name] then
        exit for
   endif
next mForm

mForm.show

This is untested.

R,
Mike



Sun, 27 Feb 2000 03:00:00 GMT  
 How to load form using form name from field

Hi,

        You could define a sub like:

Sub LoadFormByName(MiFormName as String)
Dim I as Integer

    for i=0 to forms.count -1
        if forms(i).name=MiFormName then
            forms(i).show       'Load and show the matching name form
            exit sub
        enf if
    next i
End Sub
--
        Salu2,

                Leon

-----------------------------------------------------------------------
     '''       | Behind every successful man is a woman,

-ooO-(_)-Ooo-----------------------------------------------------------
.....   888         888888                        Leon Gonzalez Alvarez
.....   888         88888888    TELEFONICA        c/ Emilio Vargas, 6
.....   888    8    888   888  INVESTIGACION      28043 Madrid (SPAIN)
ooooo   888  88888  888   888       Y             Phone:  +34 1 337 4729
ooooo   888    8    88888888    DESARROLLO        Fax:    +34 1 337 4352

------------------------------------------------------------------------



Fri, 03 Mar 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

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

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

3. Load a form foven a form name

4. Run-Time form loading - form name retrieved from database

5. calling a contol on a form using a string for the form name

6. opening a form using a string containing form name

7. load another form form one form

8. Loading a form whose name is in a variable

9. Loading a form from a variable name

10. Dynamically loaded forms by Name

11. Loading a variable named form

12. Load a form by referring to it by it's string name

 

 
Powered by phpBB® Forum Software