>In Visual FoxPro if I wanted to have a global variable available to all forms I would create a property on the screen, then it would be accessible by all forms. How do you do this type of global variable access in VB.NET? For example, I have a customer form. When the user selects a customer on that form then activates a customer orders form, I want the orders from to display data for the selected customer. The Customer Orders form is called from the main menu not from the customer form, so I can't pass a parameter.Robert,
I'm not for sure if this is the best method, but I have found this very effective... Add a new Class to your project. Then, within the class declare some variables as Public Shared...
Ex:
Public Class PublicStuff
Public Shared sVar As String
Public Shared nVar As Integer
End Class
Then, those variables can be accessed anywhere throughout the application.
Ex:
PublicStuff.sVar = "Test"
The same holds true for ASP.net as well... Hope that helps...