Example: Create a Form (Create-> Form Design) then click on View Code icon in the Ribbon menu.
To declare a variable called lstname to store string value in the Form module, you can write as seen below:
Dim lstname As String
+Standard module: To declare a variable in the Standard module, you
need to create a module by using the Visual Basic Editor:
In the Standard module, you need to declare the variable with public or private keyword instead of Dim keyword. By declaring with the public keyword the variable can be accessed through out your application. However, with private keyword the variable can be accessed only within its module. The variable declaration in the Standard module can be generally written as shown below:
Public PI As Single
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: