totn Access

MS Access 2003: Convert OutputTo macro to VBA code

This MSAccess tutorial explains how to convert an OutputTo macro to VBA code in Access 2003 (with screenshots and step-by-step instructions).

Question: In Microsoft Access 2003/XP/2000/97, how can I convert a OutputTo macro to VBA code?

Answer:Below is a macro in Access that is performing an OutputTo command. We want to convert this macro to VBA code.

Microsoft Access

In VBA, there is a command called DoCmd.OutputTo that will perform the same function as the macro version.

To convert the macro above to VBA code, you would use the following command:

DoCmd.OutputTo acOutputQuery, "Engineering", acFormatXLS, "test1.xls", False