Variable declared as Public is not appearing in all modules

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • asquaredb
    New Member
    • Jan 2014
    • 2

    Variable declared as Public is not appearing in all modules

    I have just realised that this forum is for Professionals and I am out of place so I will understand if I get bumped off.
    However, the problem I have is rather odd and maybe a professional developer will have the answer.
    Using VB6 on a computer running MS XP Professional, I have written a program which includes several forms and a .BAS module as the sub Main().
    In one of the forms I can get a value for a variable which I wish to use in the other forms. This variable has been declared as Public in the .BAS module and should be available in all forms.
    But it isn't and I am at a complete loss as to why.
    Can anyone help me please?
    Thanks in advance
    asquaredb
  • asquaredb
    New Member
    • Jan 2014
    • 2

    #2
    Actually I think I have cracked it. I changed the name of the variable, declared it as Public and ran the program. It worked fine.
    The original variable name was path - which as far as I know, is not a reserved word. So why it did not work I will never know.
    Thank you for your patience and sorry to have bothered you all.
    asquaredb

    Comment

    Working...