Chapter 11. Enhancing Reports with VBA

This chapter focuses on the ability to modify Access Reports using VBA programming. If you have read the chapter about enhancing forms, then in this chapter you will recognize many of the same concepts that occurred there. There are many similarities, in that each object has its own properties, which can execute an event procedure. For example, the Form object has an Open event procedure and the Report object has one as well. Once you learn how to utilize an event procedure for one object, using that same event procedure in another becomes very simple.

When programming for a form, there are certain issues to worry about, such as application flow, searching for data, entry of data, and data validation. Almost none of this needs to occur when programming for a report. By the time a report executes, the data should already exist within the tables, and the report is just a printed copy of the information.

The examples contained within this chapter will get you on the road to solving challenging reporting problems that you may come across. It will start with a discussion of the available event properties, and will then move to specific examples. The specific examples are structured to demonstrate functionality that can be added to an event procedure. Specifically, the Open, No Data, Format, and Print event procedures are addressed. After these techniques are understood, the common problem of computing a running balance is addressed. The last example ...

Get Access 2003 VBA Programmer's Reference 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.