Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links

DoCmd Examples - Access 2007 VBA
Output To DoCmd

Docmd Macro VB Examples Macro DoCmd Functions

Access Database Tutorials>DoCmd Examples>DoCmd OutputTo

Download Access Database >



DoCmd AddMenu
DoCmd ApplyFilter
DoCmd CancelEvent
DoCmd Close
DoCmd CopyObject
DoCmd DeleteObject
DoCmd FindRecord
DoCmd FindNext
DoCmd GotoControl
DoCmd HourGlass
DoCmd Min/Max/Restore
DoCmd OpenForm
DoCmd OpenQuery
DoCmd OpenReport
DoCmd OutputTo
DoCmd RunSQL
DoCmd SendObject
DoCmd TransferDatabase
DoCmd TransferText

Create Export Specs



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

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

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

The Docmd.OutputTo method has these arguments:

Argument Description

Objecttype - may be any of the following constants:

  • acOutputForm

  • acOutputModule

  • acOutputQuery

  • acOutputReport

  • acOutputTable


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 an Export Specification file to use with the DoCmd.TransferText command.





Contact Information

Custom Software Developers
MS Access 2007 2003 2000 All Windows Versions