473,394 Members | 1,965 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,394 software developers and data experts.

PrintMode

I am using the example out the Northwinds Sample DB that uses the following
procedure

Sub PrintReports(PrintMode As Integer)
On Error GoTo Err_Preview_Click

Dim stDocName As String
Dim ReportSelection As String

ReportSelection = Me.cboLabelFormat

If ReportSelection = "JDC Format" Then
stDocName = "rptLabelsFormatJDC"
DoCmd.OpenReport stDocName, PrintMode
End If

Exit Sub

The code attached to my Preview button and my Print button looks like this:

Private Sub cmdPreview_Click()

PrintReports acPreview

End Sub

Private Sub cmdPrint_Click()

PrintReports acNormal

End Sub

My question is this; what code do I need to write to make use of a text box
on my form for number of copies. I realize that doing something like:
DoCmd.OpenReport stDocName, acViewPreview
DoCmd.PrintOut , , , , Me.txtQuantity
DoCmd.Close acReport, stDocName

would work but stDocName is in a different procedure and I have a lot of
report selections.

Thanks in advance for any guidance.

Brandon Schultz
Nov 12 '05 #1
1 2306
Brandon,

Use the following code to print your report and it will invoke the standard
Windows print dialog where you can set the number of copies.

DoCmd.RunCommand acCmdPrint
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Brandon Schultz" <br*************@tds.net> wrote in message
news:3f********@newspeer2.tds.net...
I am using the example out the Northwinds Sample DB that uses the following
procedure

Sub PrintReports(PrintMode As Integer)
On Error GoTo Err_Preview_Click

Dim stDocName As String
Dim ReportSelection As String

ReportSelection = Me.cboLabelFormat

If ReportSelection = "JDC Format" Then
stDocName = "rptLabelsFormatJDC"
DoCmd.OpenReport stDocName, PrintMode
End If

Exit Sub

The code attached to my Preview button and my Print button looks like this:

Private Sub cmdPreview_Click()

PrintReports acPreview

End Sub

Private Sub cmdPrint_Click()

PrintReports acNormal

End Sub

My question is this; what code do I need to write to make use of a text box
on my form for number of copies. I realize that doing something like:
DoCmd.OpenReport stDocName, acViewPreview
DoCmd.PrintOut , , , , Me.txtQuantity
DoCmd.Close acReport, stDocName

would work but stDocName is in a different procedure and I have a lot of
report selections.

Thanks in advance for any guidance.

Brandon Schultz

Nov 12 '05 #2

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

Similar topics

4
by: Brent White | last post by:
The aspx file was originally default.aspx, but I'm putting some other aspx files in that same virtual directory and I want to give it a more meaningful name. I renamed default.aspx in the IDE to...
4
by: Nathan Sokalski | last post by:
I was testing out a page of mine that displays the information from Page.Request.Browser. It works exactly as I expected in Internet Explorer and Netscape 4.75 (I didn't expect much in Netscape...
5
by: El | last post by:
I have a table called Product Code Master with fields Product_Code and Description. Currently I have individual reports set up for different types of products and the user simply clicks a macro...
1
by: Kbalz | last post by:
Having a really hard time finding solid examples on deploying a CR .NET applcation on my intranet. I'll explain what I've done so far, and toward the bottom is where I can't print using the report...
15
ironmonkey69
by: ironmonkey69 | last post by:
Is there a way to use python to extract a value from an xml file?
6
by: ladybug76 | last post by:
Hello. Okay, so I have an Option Group with 6 reports on the Right hand side of a form. On the left, I have 4 command buttons. 1) Preview 2) Print 3) Save off 4) Email. I want the user to be...
6
by: xraive | last post by:
I am trying to pass the parameters when I open a report but the report opens with all records instead of being filtered. Dim strReport As String Dim strDateField As String Dim startDate As...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.