Share this Page URL

Chapter 6. Sorting, Filtering, and Retri... > Designing Select Queries - Pg. 219

Sorting, Filtering, and Retrieving Data 219 6. Keeping the Total row for this calculated field set to the default value Group By will cause an error when you run the query. The error message will indicate that you can't use an aggregate function (such as Sum ) in a Group By clause. If you see this error message, changing the Total row to Expression should solve the problem. On the toolbar, click the Run button to see the query's results, which are shown here: 7. This query could be used as the basis of a form (or a subform) or a report. You could run the query each time campaign expenses were updated and include the information as part of a campaign progress report. Using Visual Basic, you could run this query (or one like it) as part of an event procedure, using the OpenQuery method of the DoCmd object. Click the Save button to save the query, and then close the Query window.