Submitted By: Rob Wheale

Exports an Access report to a snapshot file. Includes constant values for other file formats.

Visual Basic
Edit|Remove
const acQuitSaveNone = "2" 
const acViewPreview = "2" 
const acViewNormal = "0" 
const acOutputReport = "3" 
const acSendReport = "3" 
const acFormatRTF="Rich Text Format (*.rtf)" 
const acFormatXLS="Microsoft Excel 97-2002 (*.xls)" 
const acFormatSNP="Snapshot Format (*.snp)" 
const acFormatHTML="HTML (*.html)" 


strPathToMDB = "C:\DataBases\FTPFileReport.mdb" 
strReport = "FTP File Report"
strPathToFile = "C:\Temp\" & strreport & ".snp"

        Set objAccess = CreateObject("Access.Application") 


        ' Open the desired database 
        objAccess.OpenCurrentDatabase(strPathToMDB) 

	'Save Report to file
	objAccess.DoCmd.OutputTo acOutputReport, strreport, acFormatSNP, strPathToFile

        ' Clean up 
        objAccess.CloseCurrentDatabase 
        objAccess.Quit 
        Set objAccess = Nothing