sub5
Programmer
- Oct 12, 2005
- 104
If I have a variable set as Private strName as String in the declarations section of form1 and I have another Private strName as String declaration in form2 will that cause any problems?
I want the same name because they represent the same piece of data type, but I want the instance ie Jack or John to only be read and available within each form.
What happens if I have another variable declared in a stand alone module as Public strName as String.
Is there a best practice? ie keep the two private declarations (so when maintaining the programmer knows that this variable is only relevant to this form) or combine them as a Public StrName as String variable in a stand alone module (form1 and form2 are never open at the same time) so the whole project is less messy ie without duplication of the same variable type?
Thanks in advance for your information and thoughts.
I want the same name because they represent the same piece of data type, but I want the instance ie Jack or John to only be read and available within each form.
What happens if I have another variable declared in a stand alone module as Public strName as String.
Is there a best practice? ie keep the two private declarations (so when maintaining the programmer knows that this variable is only relevant to this form) or combine them as a Public StrName as String variable in a stand alone module (form1 and form2 are never open at the same time) so the whole project is less messy ie without duplication of the same variable type?
Thanks in advance for your information and thoughts.