DoCmd OutputTo in Microsoft Access

 

Access Docmd OutputTo Method Example

OutputTo method carries out the Output To action in Access Visual Basic.

Access docmd outputto example

(command line continued below)
outputto action method tutorial

DoCmd.OutputTo objecttype[, objectname][, outputformat][, outputfile][, autostart][, templatefile]

The Docmd.OutputTo method has these arguments:

Argument Descriptions:

Objecttype – may be any of the following constants:

  • acOutputForm

  • acOutputModule

  • acOutputQuery

  • acOutputReport

  • acOutputTable

New! Download a running example of the Docmd.OutputTo Method

Objectname  – A string expression that is a valid name for the object type selected in the Object Type argument. To output the current active object then leave this argument blank.

Outputformat – Choose on of the following constants:

  • acFormatActiveXServer

  • acFormatHTML

  • acFormatIIS

  • acFormatRTF

  • acFormatTXT

  • acFormatXLS

Leave the outputformat argument blank to select the output format at runtime.

Outputfile – A string expression specifying the full path and name of the destination object. To enter the destination at runtime leave this argument blank.

Autostart – Use True (1) to start the appropriate Microsoft Windows�based application immediately, with the file specified by the outputfile argument loaded. Use False (0) if you don’t want to start the application. This argument is ignored for Microsoft Internet Information Server (.htx, .idc) files and Microsoft ActiveX Server (*.asp) files.  False is the default value.

Templatefile – A string expression specifying the full path and name for a template.  This is appropriate for HTML, HTX, and ASP files.

See our tutorial for creating anExport Specification file to use with the DoCmd.TransferText command.

Microsoft Office:
MS Access 2003
Access 2007
Access 2010
Access 2013

 

Microsoft Office VBA, MS Access 2003, 2007, 2010, 2013, 2016