Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / January 2007

Tip: Looking for answers? Try searching our database.

Preview and print report problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dinadvani - 02 Jan 2007 06:19 GMT
Hi All,

I am faing issues with command button, I have a small window that pops up
when view reports option is selected from swicthboard.
Now in view report I have 5 different reports, I wld like to create 1 single
"Preview", "Print" and "Mail Report" command buttons for all the 5 reports.
for that i have put all the five reports in option group.

But with the below code only cancel button only works

Option Compare Database  ' Use database order for string comparisons.
Option Explicit  ' Requires variables to be declared before they are used.

Sub PrintReports(PrintMode As Integer)

On Error GoTo Err_Preview_Click
   ' This procedure used in Preview_Click and Print_Click Sub procedures.
   ' Preview or print report selected in the ReportToPrint option group.
   ' Then close the Print Sales Reports Dialog form.

   'Dim strWhereCategory As String

   'strWhereCategory = "CategoryName = Forms![View Reports]!SelectCategory"
DoCmd.OpenForm "Reporting view"
   Select Case Me!ReportstoPrint
       Case 1
           DoCmd.OpenReport "List of Accounts", PrintMode
       Case 2
           DoCmd.OpenReport "Quarter-wise Report", PrintMode
       Case 3
           DoCmd.OpenReport "Accountwise Fee Report", PrintMode
       Case 4
           DoCmd.OpenReport "Difference in Projected and Actual Report",
PrintMode
   End Select
   DoCmd.Close acForm, "Reporting view"

Exit_Preview_Click:
   Exit Sub

Err_Preview_Click:
   Resume Exit_Preview_Click

End Sub

Private Sub Cancel_Click()

' This code created by Command Button Wizard.
On Error GoTo Err_Cancel_Click

   ' Close form.
   DoCmd.Close
   
Exit_Cancel_Click:
   Exit Sub
   
Err_Cancel_Click:
   MsgBox Err.Description
   Resume Exit_Cancel_Click

End Sub

Private Sub Preview_Click()
PrintReports acPreview
End Sub

Private Sub Print_Click()
PrintReports acNormal
End Sub
dinadvani - 02 Jan 2007 07:01 GMT
Please IGNORE, I found a way

>Hi All,
>
[quoted text clipped - 65 lines]
>PrintReports acNormal
>End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.