[AccessD] Snapshot Viewer question

Bruce Bruen bbruen at bigpond.com
Mon May 26 08:53:48 CDT 2003


Arthur,

Following is from my code library - don't know the source - apologies to
the author.

Bruce

The following example outputs a snapshot file to disk or embedded in a
mail message depending on the value supplied in the intOutputTO
argument. There are two global constants defined in the declarations
section of the module that are used to specify the type of output
desired. If the intOutputTO argument contains the constant
conSaveSnapshotToDisk, then the file is saved using the location and
file name supplied in the strPath argument. If the intOutputTO argument
contains the constant conSaveSnapshotToMail, then the file is embedded
in a mail message addressed to the name supplied in the strRecipName
argument. The strName argument is the name of a Report object in the
current database. The strPath argument is the full path and file name
representing the snapshot file to be saved to disk.

Const conSaveSnapshotToDisk As Integer = 1
Const conSaveSnapshotToMail As Integer = 2

Sub OutputSnapshotFile(intOutputTO As Integer, _
    strName As String, Optional strPath As String, _
    Optional strRecipName As String)

    Dim strOutputFormat As String
    DoCmd.Hourglass True
    strOutputFormat = "Snapshot Format"

    Select Case intOutputTO
        Case conSaveSnapshotToDisk
            If Len(strPath) > 0 Then
                DoCmd.OutputTo acOutputReport, _
                    strName, strOutputFormat, strPath
            Else
                DoCmd.Hourglass False
                Exit Sub
            End If
        Case conSaveSnapshotToMail
            If Len(strRecipName) > 0 Then
                DoCmd.SendObject acSendReport, _
                    strName, strOutputFormat, strRecipName
            Else
                DoCmd.Hourglass False
                Exit Sub
            End If
        Case Else
    End Select
    DoCmd.Hourglass False
End Sub

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Monday, May 26, 2003 11:31 PM
To: AccessD
Subject: [AccessD] Snapshot Viewer question


How do you save a report as a snapshot programmatically? I think I've
done it years ago but can't remember how.

TIA,
Arthur

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list