Access VBA Macro Programming

(Joao Candeias) #1

Chapter 2 Variables, Arrays, Constants, and Data Types


Chapter 2 Variables, Arrays, Constants, and Data Types


A


lthough the concept of having places to store data while the program is running
is fairly straightforward, variables, arrays, and constants have some fairly
complicatedrules. They are intrinsic to any program, so I have devoted a chapter
to explaining about them.


Variables


Building up a structure ofvariablesis a bit like building up a filing cabinet at home. You
might have files for your job, insurance policies, taxation, and personal documents such as
passports. These files can grow in size. Some may only hold a single document, such as an
insurance policy, while others can carry quite a lot of information, such as a tax file.
The important thing is that each file has a particular category of document. You would not
file your passport in with your tax papers, for example. You need to know which file holds
which papers for quick and easy reference.
Think of a variable as being similar to a particular file holding a specific type of
information. The variable may just be a single number or a piece of text that the program
needs to hold and refer to while it is running. It could also be a whole array of information,


13

Free download pdf