473,779 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

print reports on click

Kil
I designed a form that allows the user to enter dates, and click a
checkbox so that certain forms may be loaded. However, I have had
trouble getting the right information to load.
I would like to enable certain reports to be displayed as the user
checks the box and the clicks the cmdReport button. Also, is there a
certain way to combine reports, loaded separately, to load into one for
printing (e.g. report1 and report2 are checked, how to concatenate them
into one page)?

Here is the code that I have that works, but severely limited:

Private Sub cmdReport_Click ()
On Error GoTo Err_cmdReport_C lick

Dim stDocName As String

stDocName = "rptDateParamet erReport"

'Check values are entered into Date From and Date To text boxes
'if so run report or cancel request

If Len(Me.txtdatef rom & vbNullString) = 0 Or Len(Me.txtDateT o &
vbNullString) = 0 Then
MsgBox "Please ensure that a report date range is entered into
the form", _
vbInformation, "Required Data..."
Exit Sub
Else
DoCmd.OpenRepor t stDocName, acPreview
End If
Exit_cmdReport_ Click:
Exit Sub

Err_cmdReport_C lick:
MsgBox Err.Description
Resume Exit_cmdReport_ Click

End Sub

It works, but only loading one report from the form. I haven't yet
found or worked out a method that will check to see if the boxes are
checked for more than one report to be loaded at once, and combined.
Thank you!

Aug 28 '06 #1
2 2182
You cannot combine reports in the way you are asking. If you want to
load multiple reports, you would check your checkbox values in the Else
portion of your If statement.

If Me.YourCheckbox Name = True Then
'Open the report
DoCmd.OpenRepor t "ReportName ", acPreview
End IF

Hope that helps!


Kil wrote:
I designed a form that allows the user to enter dates, and click a
checkbox so that certain forms may be loaded. However, I have had
trouble getting the right information to load.
I would like to enable certain reports to be displayed as the user
checks the box and the clicks the cmdReport button. Also, is there a
certain way to combine reports, loaded separately, to load into one for
printing (e.g. report1 and report2 are checked, how to concatenate them
into one page)?

Here is the code that I have that works, but severely limited:

Private Sub cmdReport_Click ()
On Error GoTo Err_cmdReport_C lick

Dim stDocName As String

stDocName = "rptDateParamet erReport"

'Check values are entered into Date From and Date To text boxes
'if so run report or cancel request

If Len(Me.txtdatef rom & vbNullString) = 0 Or Len(Me.txtDateT o &
vbNullString) = 0 Then
MsgBox "Please ensure that a report date range is entered into
the form", _
vbInformation, "Required Data..."
Exit Sub
Else
DoCmd.OpenRepor t stDocName, acPreview
End If
Exit_cmdReport_ Click:
Exit Sub

Err_cmdReport_C lick:
MsgBox Err.Description
Resume Exit_cmdReport_ Click

End Sub

It works, but only loading one report from the form. I haven't yet
found or worked out a method that will check to see if the boxes are
checked for more than one report to be loaded at once, and combined.
Thank you!
Aug 28 '06 #2
Hi Kil,

If you want to select multiple reports and print them with one click of
the button on your form you could consider the folowing method which I
use sometimes:

Have a form with a list box which lists the available reports, with the
multiselect property set to True.

You can then have the on click event of the command button that
activates the report go through the selected items in the list box and
print them.

Let me know if you need more info.

Phivos


Kil wrote:
I designed a form that allows the user to enter dates, and click a
checkbox so that certain forms may be loaded. However, I have had
trouble getting the right information to load.
I would like to enable certain reports to be displayed as the user
checks the box and the clicks the cmdReport button. Also, is there a
certain way to combine reports, loaded separately, to load into one for
printing (e.g. report1 and report2 are checked, how to concatenate them
into one page)?

Here is the code that I have that works, but severely limited:

Private Sub cmdReport_Click ()
On Error GoTo Err_cmdReport_C lick

Dim stDocName As String

stDocName = "rptDateParamet erReport"

'Check values are entered into Date From and Date To text boxes
'if so run report or cancel request

If Len(Me.txtdatef rom & vbNullString) = 0 Or Len(Me.txtDateT o &
vbNullString) = 0 Then
MsgBox "Please ensure that a report date range is entered into
the form", _
vbInformation, "Required Data..."
Exit Sub
Else
DoCmd.OpenRepor t stDocName, acPreview
End If
Exit_cmdReport_ Click:
Exit Sub

Err_cmdReport_C lick:
MsgBox Err.Description
Resume Exit_cmdReport_ Click

End Sub

It works, but only loading one report from the form. I haven't yet
found or worked out a method that will check to see if the boxes are
checked for more than one report to be loaded at once, and combined.
Thank you!
Aug 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1787
by: Claudia Fong | last post by:
Hi, I have 4 reports created in Ms-access and I will use VB to print those reports. My problem is I'm not sure if I can control wich report to print.. Those reports are almost the same, what is different is the logo in the report header or page header. Because there are 4 different logo. I want the user to choose in VB which logo to use and then VB will print the report that the user chose.
5
1784
by: Tony Dong | last post by:
Hi there, I am newer for dot net I want to make a report and then print it, the report may include images and text, how can I do that, any one can give me a suggestion? I know how to working with printers, but it looks just support text or image separately. Can I use cystal report to make a report and then use dot net program to
2
14130
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002 database? Thanks, Dean Slindee
2
14466
by: Rod | last post by:
We've got an old VB6 application which has 9 Crystal Reports it can print. These 9 reports are considered by our users to be in essence one "report", in the sense that they are all related and they cannot make their business plans without all 9 reports. However, they really are 9 separate reports, 7 of which have sub-reports in them. One of my colleagues has been working on converting them from the VB6 app, to .RPT files which can be...
4
13695
by: sara | last post by:
Hi - I've looked at many posts, and cannot find the answer on this specific problem. I have several fields on a table, which I've defined as "Text", 3 characters, Format Yes/No (I picked up the Text and Format Yes/No from a Posting). I have a form with a label and a check box for each item and the user checks off the ones s/he wants to be "Yes".
5
10942
by: Neetu | last post by:
Hi Everybody, Our reports works well on every machine but not on 64bit systems. We can view the report but when we press print button it does nothing, it just stay there and prompt nothing, even no exceptions. Even it does not execute the test code we wrote: Dim pd As New PrintDialog pd.ShowDialog()
1
2250
by: ajaykhedekar | last post by:
I am Showing Mulitple MSRS Reports on Single ASP.Net WEB Page using Mulitple ReportViewer Controls. If User wants to Print the Reports, then user has to click Print button provided by ReportViewer Control multiple times, So I want to do this with one button Click.This Button Click event will handle the Printing process of ReportViewer Control. In Case of CrystalReportViewer we have direct functions as "PrintReport" and "ExportReport" to Print...
0
3116
by: EricJudge06 | last post by:
We are converting some reports from Crystal Reports to Microsoft SQL Reporting Services (SSRS) in an ASP 2.0 VB.Net web app. Crystal had a function called PrintToPrinter which was being used to programmatically print to a network printer that we specified in the code as soon as the user clicked a button on the screen. The printer dialog box did not appear. It was true one-click printing. I need to figure out how to do the same thing in...
10
9122
by: Snoopy33 | last post by:
I have a DB that I developed on access XP (2002) and deployed over a year ago. No one has had problems printing any of the reports within the DB until we started loading 2007 on new computers. The access 2007 users cannot print one of the reports. This is maddening since I cannot duplicate the issue on any computer that runs 2003 or below. Is there something going on that I'm not seeing? Does anyone have any suggestions at all on...
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.