VBA History
(Visual Basic for Applications)
To look at VBA history, we need to understand the beginnings of programming. Original programming was done in ‘Text’ format and it was very structured. The user could only follow a set path as determined by the program. A user could make choices, but once that choice was made a set course was determined, unless the user went back to the start and chose another course. The program was carried out line by line. As an example the first line of code was carried out, then the second and so forth. The code could jump to a specific section of the code, but it was not very flexible. These text based programs were called procedural. Some of you may still be using these text based programs; they can often be identified by green writing on a black screen, not very user friendly. These Text based programs also rely on the Keyboard for user input, rather than a mouse.
VBA history - GUI
This all changed with the Graphical User Interface (GUI). An example of a GUI is Windows®, now instead of text the user could move around the program, with the click of a mouse. There were graphics instead of text – i.e. toolbars. The user now had ‘pretty’ forms to enter the data and the data could be displayed in a variety of ways. These GUI interfaces are the basis for Event Driven programming. An event can be triggered and code invoked by the click of a mouse, hitting a key on a keyboard, opening a form or saving a record, to name a few.
VBA is both Event and procedural. As an example, invoking an event, like clicking on a certain location on a screen (EVENT), will commence the action of a piece of code, but that code will still be executed line by line (PROCEDURAL). In the latter versions of Visual Basic® for Applications development system Object Based/Orientated Programming has been introduced.
VBA is related to the Visual Basic programming language, but where Visual Basic is more of a general programming tool and can build stand alone applications, VBA is specific to Word, Excel, Outlook or Access and has tools to develop codes specific for these programs. If you are buying books on Visual Basic® for Applications be careful you do not buy books on Visual Basic ®. This is a common mistake. For the purpose of these lessons we will be looking at VBA in relation to Microsoft® Access, but the skills you learn here can be applied to other components of the Microsoft® Office software suite.