Variables are used to temporarily store values during the execution of an application; they are placeholders in the memory for an unknown value. The scope of a variable defines which parts of the code are aware of its existence. The scope of the variable when they are declared under different modules and procedures are listed below:

1.Declaring the variable in a procedure using the Dim statement makes the variable available only to the procedure.

2.Declaring the variable in the Declaration’s section of a form (standard or class module), using the Dim statement makes the variable available to all the procedures in the module.
3.Declaring the variable in any module or the Declaration’s section using the Public keyword makes it available throughout the application.

[Public | Dim] varname [As type]

varname: Name of the variable declared.
type: Data-type of the variable declared (optional).

The data-type of a variable determines how the bits representing stored values are stored in the computer’s memory. All variables have a data-type that determines what kind of data they can store. The different data-types are:

String Data-Type:
This data-type stores text. By default, a string variable is of variable length. To declare strings that have a fixed length the following syntax should be used:
Dim varname As String * size

Boolean Data-Type:
This data-type stores True/False values. The default value is False (0), any integer other than 0 is True.

Byte Data-Type:
Data is stored in bytes; this data-type basically holds an integer in the range 0 to 255 giving access to individual bytes. Some API calls use the Byte data-type.

Date Data-Type:
This data-type stores date and time values. They are double-precision numbers: the integer part represents the data and the fractional part represents the time.

Integer Data-Type:
This data-type stores integer values in the range –32,768 to 32,767.

Long Data-Type:
This data-type stores integer values in the range –2,147,483,648 to 2,147,483,647

Single Data-Type:
This data-type stores single-precision floating-point numbers.

Double Data-Type:
This data-type stores double-precision floating-point numbers.

User-Defined Data-Type:
This data-type is created combining variables of several different data-types. This type of variable is useful when one wants to create a single variable that records several related pieces of information and can be declared using the Type statement

Declaration Syntax:
[Private | Public] Type varname
elementname [subscripts] As type
elementname [subscripts] As type

End Type

varname: Name of the user-defined variable type. Prefix “udt”.
elementname: Name of the element of the user-defined type.
subscripts: Dimensions of an array variable (optional).
type: Data-type of the element.

So much for making a mistake of not telling ppl that I haven't written the tutorial in LINUX, didn't know that I had to give credits... sorry for that folks.