Planning the Code

The first step in planning the VBA code is to decide how it will access the data source. There is no need to automate the Access application, as it will be more efficient to use ADO data access directly. We are interested in records going back three months for one data view, six months for another, and 12 months for the third. We could create a recordset containing all records from the DailySales table going back 12 months, then extract the six month and three month subsets using VBA code. However, why not use the power of ADO to simply create three separate recordsets—one for 12 months worth of data, one for six months, and one for three months? This will simplify the VBA code required by the project. This means, of course, ...

Get Office® XP Development with VBA 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.