Teaching a programming language is not a linear process. Many times I need to touch on a topic, move on to the next topic, and then return to the original topic incorporating the second topic. That is what is going on here. We looked at some elements of VBA in Chapter 6, moved on to the VBA Editor in Chapter 7, and now we will bring both together in this chapter. In the process, we will be revisiting topics from both chapters.
We will reexamine objects, events, and variables and take a look at SQL and how to query the database using forms. In between, we will do some actual coding. But first, let’s quickly review what you have learned about procedures.
You’ve seen that a procedure has an opening declaration as well as an ending statement. Between those two lines, you have variables (which could also be arrays), assignment statements, and objects (which contain their own attributes and methods). The procedure can also contain programming structures to make decisions (If…Then…Else) and loops to repeat a block of code a certain number of times, or until a condition is met.