Writing a Function that Uses Database Objects

All database objects that you can create and manipulate with Access's graphical development environment also can be created and manipulated with Access VBA code. You can use Access VBA to create a new table, to add records to the table, to define a query to select records from the table, to create a form to display the data, and then to print a report. In other words, you can use Access VBA to create an application exactly the same way you use the dBASE language or PAL. The purpose of Access's graphical development environment, however, is to minimize the need for code in applications.

The nilTestQuery function you write in the following example uses the QueryDef and Database object data types to ...

Get Special Edition Using Access 97, Second Edition 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.