473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Print all open database objects

20
I need two reports to print at the same time. Repor1 is always the same. There is a button on Report1 that when pressed will open one of several other reports based on the value entered in one of the controls on Reprt1. This report becomes Report2, the second report that I need to print. Basically Report1 is a given and Report2 is a variable that changes from record to record. Once they are both open, I would like to be able to print both of the reports at once so that the user doesn't have to print them both separately. What is the best way to achieve this? Can I program it into my existing button? Thanks.
Jul 25 '19 #1
2 980
twinnyfo
3,653 Expert Mod 2GB
When you open your report, the acViewNormal property causes the report to be sent to your default printer with the printer’s default settings.

Hope this hepps.
Jul 28 '19 #2
ADezii
8,834 Expert 8TB
  1. The way that I interpret your Request is that you need two things to happen prior to actually Printing the Reports:
    1. You need to make sure that at least two Reports are 'Open'.
    2. If at least two Reports are 'Open', then you need to make sure that they are the correct ones to Print.
    3. Once the previous conditions are met, then Print both Reports.
  2. These things can easily be accomplished by looking at the Reports Collection as well as using a couple of Boolean Variables.
  3. The following Code should accomplish what you have requested. For the purposes of this Demo, I named the Reports Shippers and Suppliers.
  4. Code Definition:
    Expand|Select|Wrap|Line Numbers
    1. Dim rpt As Access.Report
    2. Dim blnShippersFound As Boolean
    3. Dim blnSuppliersFound As Boolean
    4.  
    5. 'Need at least 2 Reports Open
    6. If Application.Reports.Count < 2 Then Exit Sub
    7.  
    8. For Each rpt In Application.Reports
    9.   Select Case rpt.Name
    10.     Case "Shippers"
    11.       blnShippersFound = True
    12.     Case "Suppliers"
    13.       blnSuppliersFound = True
    14.     Case Else   'don't really care
    15.   End Select
    16. Next
    17.  
    18. 'Both need to be Opened
    19. If (blnShippersFound And blnSuppliersFound) Then
    20.   With DoCmd
    21.     .OpenReport "Shippers", acViewNormal
    22.     .OpenReport "Suppliers", acViewNormal
    23.   End With
    24. End If
Jul 29 '19 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bryan J Gudorf | last post by:
We at NeuroKode Labs, LLC, are proud to announce the release of Python Database Objects (PDO) 1.0.1. The current release adds support for PostgreSQL via the pgdb Module. As released previously:...
0
by: Bryan J Gudorf | last post by:
We at NeuroKode Labs, LLC, are proud to announce the release of Python Database Objects (PDO) 1.0.2. The current release adds kinterbasedb, (firebird, interbase) support. As released previously:...
0
by: Bryan J Gudorf | last post by:
Python Database Objects 1.1.0 has been released. This fairly stable test release includes support for various databases through the mxODBC module. This release also adds more functionality through...
10
by: Bryan J Gudorf | last post by:
PDO, an open source python module for interfacing with RDBMS (SQL databases), has now reached 1.2.0! PDO provides an object oriented API, similar to that of ADO or JDBC, to python developers. PDO...
0
by: Jon Franz | last post by:
----- Original Message ----- From: "Jon Franz" <jfranz@neurokode.com> To: "Serge Orlov" <sombDELETE@pobox.ru> Sent: Wednesday, November 19, 2003 2:39 PM Subject: Re: Python Database Objects (PDO)...
3
by: I Are Confused | last post by:
I am trying to open Database #2 while in Database #1 and delete a table that is in #2 so that I can copy a table from #1 into #2 - all through a function. My Database #2, as part of the start up,...
3
by: Bruce | last post by:
Hello, I have a number of instances in which I need to grab a single value from a table based on an index. Usually that table is an attached table. I know Access provides the DLookup function...
3
by: Sylvia | last post by:
I was looking over the web, trying to see if anyone has ever had the trouble I'm experiencing and so far no dice. Has anyone ever heard of someone not being able to view the database objects of an...
2
by: Rob Richardson | last post by:
Greetings! It seems to me that there is room for a lot of improvement in automatic generation of database objects. If I create a data adapter from a table shown in the Server Explorer, I get...
5
meLady
by: meLady | last post by:
Hello, I have two database applications and they are: - the (A) application is for administration use. - the (B) application is for normal users use. the idea is that: I made the (A)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.