Class Mod Workaround & Multiple forms 
Author Message
 Class Mod Workaround & Multiple forms

Is it possible to use multiple forms in a single app?  If so, how do I
open/close the forms?  How do I reference objects on one form from another?

Also, is it possible to put all globals and "public" functions on one main
form that will remain hidden for the duration of the program, but still
reference those variables/functions as you would a class module?

Thanks,
Anthony



Sun, 11 Jul 2004 02:59:56 GMT  
 Class Mod Workaround & Multiple forms
Sure you can use multiple forms, you just can't unload them.  Use the Hide
and Show methods instead.

To reference an object in another form, preface it with the Form name:

<Form1 globals>
Public m_MyVariable As String
</Form1 globals>

<Form2 Code>
x = Form1.m_MyVariable
</Form2 Code>

To make globals accessible without the Form name, put them in a Module.

-Chris


Quote:
> Is it possible to use multiple forms in a single app?  If so, how do I
> open/close the forms?  How do I reference objects on one form from
another?

> Also, is it possible to put all globals and "public" functions on one main
> form that will remain hidden for the duration of the program, but still
> reference those variables/functions as you would a class module?

> Thanks,
> Anthony



Sun, 11 Jul 2004 09:22:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Pass integer Value from forms Class mod to report class mod

2. rename class mod

3. Access 97 Class Mod Error Trap Weirdness

4. Class Modules and Multiple forms?

5. Multiple classes with a class

6. .mod & .xm files

7. Workaround for drag & drop from Stencil window

8. VB .Net Bug & workaround

9. VB6 DataCombo update bug & workaround

10. VB4/SQL Workaround for RollBackTrans & Error 40002

11. Sendkeys Bug, Numlock & KB workaround problem

12. Forms & Class

 

 
Powered by phpBB® Forum Software