Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print dialog

Status
Not open for further replies.

bfergus

Programmer
Mar 16, 1999
2
US
How can I use the print common dialog in a report? <br>
This code is executed from the click event of a command button.<br>
<br>
DoCmd.OpenReport &quot;DailyReport&quot;, acNormal<br>
<br>
I will like to give the users the option to print several copies of a report.<br>
<br>

 
Here is a quick option<br>
change the acNormal to acPreview<br>
then show the end users how to Click &quot;File&quot; Menu then &quot;Print&quot;<br>
They can choose as many Copies as they want on that dialog box.<br>
or you could have an Input box which prompts the user for the number of copies and put the docmd. in a loop<br>
<br>
Dim stDocName As String, retval, a As Integer<br>
<br>
stDocName = &quot;sample&quot;<br>
retval = InputBox(&quot;Enter Number of Copies to Print&quot;, &quot;Print&quot;, 1)<br>
If retval = &quot;&quot; Then Exit Sub 'If user picks Cancel<br>
For a = 1 To retval<br>
DoCmd.OpenReport stDocName, acNormal<br>
Next<br>
<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top