Chapter 4Passing Arguments to Procedures and Functions

As you already know from Chapter 1, VBA procedures (both subroutines and functions) often require arguments to perform certain tasks. In this chapter, you learn various methods of passing arguments to procedures and functions.

Writing a Function Procedure

Function procedures can perform calculations based on data received through arguments. When you declare a function procedure, you list the names of arguments inside a set of parentheses, as shown in Hands-On 4-1.

Hands-On 4-1: Writing a Function Procedure with Arguments

1. Start Microsoft Office Access 2007 and create a new database named Chap04.accdb in your C:\Acc07_ByExample folder.

2. Once your new database is opened, press Alt+F11 to ...

Get Access 2007 Programming by Example with VBA, XML, and ASP now with O’Reilly online learning.

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