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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting printer paper sources through code.........

Status
Not open for further replies.

GWhiz

Programmer
Dec 16, 1999
49
US
Hi, folks!<br><br>Customer has a printer which has 3 different feed trays for paper.&nbsp;&nbsp;He uses different color sheets for different forms.<br><br>Paper source can be selected in code (like an event procedure when pressing a command button) using an &quot;escape sequence&quot; (defined in the printer manual).<br><br>Question:&nbsp;&nbsp;what is syntax for sending an escape sequence to a printer in code?<br><br>Used to be as simple as using &quot;LPrint&quot; (back in the olden days before Windows) -- but not sure what it is any more.<br><br>Anyone had any experience doing something like this?<br><br>Thanks so much for any help....<br><br>Doug
 
I get around the Problems by creating different reports for each task.<br>Then call the docmd.open report statement depending on a selection. Like so:<br>----------------------------------------<br>&nbsp;&nbsp;&nbsp;&nbsp;If Forms![frm-PrintPO]![CheckShip].Value = True Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenReport &quot;rpt-PO Shippers Copy&quot;, acNormal<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;DoEvents<br>&nbsp;&nbsp;&nbsp;&nbsp;If Forms![frm-PrintPO]![CheckAcct].Value = True Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenReport &quot;rpt-PO Accounting Copy&quot;, acNormal<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;DoEvents<br>&nbsp;&nbsp;&nbsp;&nbsp;If Forms![frm-PrintPO]![CheckFAX].Value = True Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenReport &quot;rpt-PO Fax Copy&quot;, acNormal<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;DoEvents<br>&nbsp;&nbsp;&nbsp;&nbsp;If Forms![frm-PrintPO]![CheckEmail].Value Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.SendObject acSendReport, &quot;rpt-PO Fax Copy&quot;, acFormatHTML, , , , &quot;Universal PO# &quot; & Left(command, 6), &quot;Please Process this PO ASAP&quot;, True<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>---------------------------<br>Here's one I'm doing right now.<br>there are Check Boxes on the form.<br>It prints 2 different reports to a printer and can also FAX or E-mail.<br>This is also great becasue each report is set up to a specific printer or margins etc.<br><br>
 
Tnx, DougP.<br><br>I have done something similar in another part of the same app here.&nbsp;&nbsp;Customer wants different color paper for certain reports, so I need to select the appropriate paper tray on the printer prior to printing.<br><br>I know it can be done -- just not sure how to do it.<br><br>Do you know how to send an escape sequence to a printer via code?&nbsp;&nbsp;Used to be LPRINT &lt;string&gt; to send a line (which could be either a line of text to print, or a command to tell the printer to, say, switch fonts or something), but that's been buried under tons of Windows debris since late 80's.<br><br>Tnx for taking the time to respond..........<br><br>Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top