Controlling the Flow of Statements

Visual Basic provides many ways for you to control the flow of statements in procedures. You can call other procedures, loop through a set of statements either a calculated number of times or based on a condition, or test values and conditionally execute sets of statements based on the result of the condition test. You can also go directly to a set of statements or exit a procedure at any time. The following sections demonstrate some of (but not all) the ways that you can control flow in your procedures.

Call Statement

Use a Call statement to transfer control to a subroutine.


Call subroutinename [(<arguments>)]
subroutinename [<arguments>]

where <arguments> is

{[ByVal | ByRef] <expression> },...


The Call ...

Get Microsoft® Access® 2010 Inside Out now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.