Print Buttons on Reports...Doable????

DblDogDare

Registered User.
Local time
Today, 14:18
Joined
Feb 14, 2003
Messages
17
I am wondering if it is possible to have 2 print buttons on a report. I want the user to have the option of printing the report to a printer or printing to a .snp. If they print to a .snp, I want to be able to set default location of the .snp. Also, is there a way to default the .snp to open "from it's current location" when accessing through the web? Any help is greatly appreciated.

Thanks
 
Buttons on reports are simply pictures. They do not have any events behind them. I've included a picture of one of my selection forms and the code behind the Run Report button.

Code:
Private Sub cmdPreview_Click()
On Error GoTo Err_cmdPreview_Click

    Dim strDocName As String
    Dim PrintMode As Integer
    gProjectID = Null
    gProjectName = Null
    

    
    Select Case Me.fraReportName
        Case 1
            strDocName = "rptCMMKPI"
        Case 2
            strDocName = "rptCMMLevel"
        Case 3
            strDocName = "rptCMMKPIforWord"
            Me.fraPrintOption = 3
        Case Else
            MsgBox "Please choose a report", vbOKOnly
            Exit Sub
    End Select
    
    Select Case Me.fraPrintOption
        Case 2
            PrintMode = acNormal
        Case Else
            PrintMode = acPreview
    End Select
    
    If Me.lstCMMLevel.ListIndex = -1 Then
        MsgBox "Please select at least one CMM Level to report on", vbOKOnly
        Exit Sub
    Else
        Call fMultiSelect(Me.lstCMMLevel)
        Select Case Me.fraPrintOption
            Case 1, 2
                DoCmd.OpenReport strDocName, PrintMode  ' , , "CMMLevelID IN(" & gMultiSelect & ")"
            Case 3
                DoCmd.OutputTo acReport, strDocName, "RichTextFormat(*.rtf)", "", True, ""
            Case 4
                DoCmd.OutputTo acReport, strDocName, "HTML(*.html)", "", True, ""
            Case 5
                DoCmd.OutputTo acReport, strDocName, "SnapshotFormat(*.snp)", "", True, ""
        End Select
    End If
Exit_cmdPreview_Click:
    Exit Sub

Err_cmdPreview_Click:
    If Err.Number = 2501 Then  ' ignore macro action cancelled error
    Else
        MsgBox Err.Number & " - " & Err.Description
    End If
    Resume Exit_cmdPreview_Click
    
End Sub
 

Attachments

  • selection.jpg
    selection.jpg
    26 KB · Views: 155

Users who are viewing this thread

Back
Top Bottom