0

Hi All

Does Anyone know how to make a variable public to all forms within the application.

Eg Public MyPath = "C:\" can do for one form but not all

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by get connected
0

If your Public declaration is on Form1, then call it like: [B]Form1.MyPath[/B] from any other Form.

Also, always set a Declaration Type when declaring something. In this case, "String" = Type.

Public MyPath As String = "C:\"
0

Another thing you could do is add a module to the project.

Module FilePathData
    Public MyPath as String = "C:\"
    'Some other stuff
End Module
0

Thanks to you both for the ideas.

I will take them onboard and use them.

codeorder - thank you once aagin for the help, the advice you give is always simple and to the point.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.