Global variables is one of the most important functionality that I use to set the tone of my application. For example a variable for the current user log-in, a variable for the default branch of the user, and so on and so forth. In Microsoft Access I use a local table associated with the ACCDB file, in Microsoft Lightswitch that wouldn’t be possible. But there is a way to declare a global variable, here’s how you’ll do it:
1. Open your application and double click on the Properties item in the logical view of the solution explorer
2. In the Screen Navigation tab of the designer click the Hyperlink “Click here to view application code.”
3. Now type in your Public Global Variables
To access your variables just type, for example, in your code: Me.Application.CurrentUserId.