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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.