Solved

Difference in “scope” of two Public variables

Posted on 2006-11-03
1
170 Views
Last Modified: 2010-04-30
What is the difference in the “scope” of these two Public variables (that are in the same VB6 project):
1. variable, sPubInFrm, declared as Public in one of the project’s forms, and
2. variable, sPubInMod, declared as Public in one of the project’s modules?

Does it make any difference if the form is the "Startup object" for the project?
0
Comment
Question by:lee88
1 Comment
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17864820
a public variable in a form will be available as member of the form object, managed as per instance of the form
a public variable in a module will be available everywhere in the project, single instance within the whole project

>Does it make any difference if the form is the "Startup object" for the project?
no
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 117
Vb.net 2008 2 60
Paint/Redraw window while dragging 16 79
VBA: copy range dynamically based on config sheet v2 3 38
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question