Why variables declared in class module cannot be used in forms.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Why variables declared in class module cannot be used in forms.

  1. #1
    Pat Guest

    Why variables declared in class module cannot be used in forms.


    The same variable I declared in regular modular is reconizable, not
    I need to declare it in class module in order to explore the events.

    THanks
    Pat

  2. #2
    Phil Weber Guest

    Re: Why variables declared in class module cannot be used in forms.

    > The same variable I declared in regular modular is reconizable,
    > not I need to declare it in class module in order to explore the
    > events.


    Pat: It would help if you can post a few lines of code illustrating how
    you're declaring the variables in the class module, and how you're trying to
    access them from the form.
    ---
    Phil Weber



  3. #3
    Grinder Guest

    Re: Why variables declared in class module cannot be used in forms.


    "Pat" <pwang@uclink.berkeley.edu> wrote in message
    news:3c5b2bf4$1@10.1.10.29...
    >
    > The same variable I declared in regular modular is

    reconizable, not
    > I need to declare it in class module in order to explore the

    events.

    It's a question of scope. A global variable declared in either
    module is visible to the entire project, but those in the class
    module must be referred to in the context of the particular
    instance. This makes sense, as multiple instances of a class
    will have it's own value for this variable, and you have to
    indicate which one you want. For a standard module, there can
    only be one "instance," so you don't need the qualification.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center