Using DAO to Execute Action Queries
Action queries were discussed in some detail in Chapter 9, “Managing Database Objects,” but from an interactive standpoint. There, in “Creating Queries,” you saw how to use Update, Delete, and Append queries to change data, remove records, and add them to the underlying tables. The context was that of a user employing the queries directly from the database's user interface.
But just as you can combine VBA with DAO or ADO recordsets to return data via Select queries, you can cause VBA to run action queries from the Excel platform, and thereby update, delete, and append records in a database. You can do this with queries that have been saved in the database or you can submit the queries' SQL along with the commands ...
Get Managing Data with Microsoft® Excel 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.