<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Jeffery:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for the code. I'll use it and stop
them killing trees. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Rocky</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=jeffrey.demulling@usbank.com
href="mailto:jeffrey.demulling@usbank.com">jeffrey.demulling@usbank.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=accessd@databaseadvisors.com
href="mailto:accessd@databaseadvisors.com">accessd@databaseadvisors.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, January 29, 2003 1:21
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [AccessD] How To Stop
Printing</DIV>
<DIV><BR></DIV><BR><FONT face=sans-serif size=2>If you want you can hide the
menu and toolbars with code like this on the Forms on open event</FONT>
<BR><BR><FONT face=sans-serif size=2>hideCommandBars</FONT> <BR><FONT
face=sans-serif size=2>DoCmd.ShowToolbar "Unassigned_BM_Loans_Forms",
acToolbarYes</FONT> <BR><FONT face=sans-serif size=2>DoEvents</FONT>
<BR><BR><FONT face=sans-serif size=2>Place this code in a module:</FONT>
<BR><FONT face=sans-serif size=2>Sub hideCommandBars()</FONT> <BR><FONT
face=sans-serif size=2> Dim cbr As CommandBar</FONT> <BR><FONT
face=sans-serif size=2> For Each cbr In CommandBars</FONT>
<BR><FONT face=sans-serif size=2> hidebar
cbr</FONT> <BR><FONT face=sans-serif size=2> Next cbr</FONT>
<BR><FONT face=sans-serif size=2>End Sub</FONT> <BR><BR><FONT face=sans-serif
size=2>Sub listbar(level As Integer, thisbar As CommandBar)</FONT> <BR><FONT
face=sans-serif size=2> Dim cbrctl As CommandBarControl</FONT>
<BR><FONT face=sans-serif size=2> Dim indent As Integer</FONT>
<BR><FONT face=sans-serif size=2> ' Indent the command bar
depending on its level in</FONT> <BR><FONT face=sans-serif size=2>
' the menu structure.</FONT> <BR><FONT face=sans-serif size=2>
For indent = 1 To level</FONT> <BR><FONT face=sans-serif size=2>
'MsgBox " "</FONT> <BR><FONT face=sans-serif
size=2> Next indent</FONT> <BR><FONT face=sans-serif
size=2> Select Case thisbar.Type</FONT> <BR><FONT face=sans-serif
size=2> Case msoBarTypeMenuBar</FONT> <BR><FONT
face=sans-serif size=2> MsgBox "Menu
Bar: " & thisbar.name</FONT> <BR><FONT face=sans-serif size=2>
Case msoBarTypeNormal</FONT> <BR><FONT face=sans-serif
size=2> MsgBox "Toolbar: " &
thisbar.name</FONT> <BR><FONT face=sans-serif size=2>
Case msoBarTypePopup</FONT> <BR><FONT face=sans-serif size=2>
MsgBox "Popup: " & thisbar.name</FONT>
<BR><FONT face=sans-serif size=2> End Select</FONT> <BR><FONT
face=sans-serif size=2> For Each cbrctl In
thisbar.Controls</FONT> <BR><FONT face=sans-serif size=2> ' If
the control doesn't have a command bar associated</FONT> <BR><FONT
face=sans-serif size=2> ' with it, then don't print it.</FONT>
<BR><FONT face=sans-serif size=2> If cbrctl.Type
<> 1 And cbrctl.Type <> 2 _</FONT> <BR><FONT face=sans-serif
size=2> And cbrctl.Type
<> 4 And cbrctl.Type <> 16 _</FONT> <BR><FONT face=sans-serif
size=2> And cbrctl.Type
<> 18 Then</FONT> <BR><FONT face=sans-serif size=2>
listbar level + 1, cbrctl.CommandBar</FONT> <BR><FONT
face=sans-serif size=2> End If</FONT> <BR><FONT
face=sans-serif size=2> Next cbrctl</FONT> <BR><FONT
face=sans-serif size=2>End Sub</FONT> <BR><FONT face=sans-serif size=2>Sub
hidebar(thisbar As CommandBar)</FONT> <BR><FONT face=sans-serif size=2>
Dim cbrctl As CommandBarControl</FONT> <BR><FONT face=sans-serif
size=2> Dim indent As Integer</FONT> <BR><FONT face=sans-serif
size=2> ' Indent the command bar depending on its level in</FONT>
<BR><FONT face=sans-serif size=2> ' the menu structure.</FONT>
<BR><FONT face=sans-serif size=2> 'For indent = 1 To level</FONT>
<BR><FONT face=sans-serif size=2> 'MsgBox "
"</FONT> <BR><FONT face=sans-serif size=2> 'Next indent</FONT>
<BR><FONT face=sans-serif size=2> Select Case thisbar.Type</FONT>
<BR><FONT face=sans-serif size=2> Case
msoBarTypeMenuBar</FONT> <BR><FONT face=sans-serif size=2>
DoCmd.ShowToolbar thisbar.name, acToolbarNo</FONT>
<BR><FONT face=sans-serif size=2> Case
msoBarTypeNormal</FONT> <BR><FONT face=sans-serif size=2>
DoCmd.ShowToolbar thisbar.name, acToolbarNo</FONT>
<BR><FONT face=sans-serif size=2> Case
msoBarTypePopup</FONT> <BR><FONT face=sans-serif size=2>
DoCmd.ShowToolbar thisbar.name, acToolbarNo</FONT>
<BR><FONT face=sans-serif size=2> End Select</FONT> <BR><FONT
face=sans-serif size=2> 'For Each cbrctl In
thisbar.Controls</FONT> <BR><FONT face=sans-serif size=2> ' If
the control doesn't have a command bar associated</FONT> <BR><FONT
face=sans-serif size=2> ' with it, then don't print it.</FONT>
<BR><FONT face=sans-serif size=2> 'If cbrctl.Type
<> 1 And cbrctl.Type <> 2 _</FONT> <BR><FONT face=sans-serif
size=2> And cbrctl.Type
<> 4 And cbrctl.Type <> 16 _</FONT> <BR><FONT face=sans-serif
size=2> And cbrctl.Type
<> 18 Then</FONT> <BR><FONT face=sans-serif size=2>
'listbar level + 1, cbrctl.CommandBar</FONT> <BR><FONT
face=sans-serif size=2> 'End If</FONT> <BR><FONT
face=sans-serif size=2> 'Next cbrctl</FONT> <BR><FONT
face=sans-serif size=2>End Sub</FONT> <BR><BR><FONT face=sans-serif size=2>I
also include the following in a module to get the menu and toolbars
back:</FONT> <BR><FONT face=sans-serif size=2>Sub showdefaultbar()</FONT>
<BR><FONT face=sans-serif size=2>DoCmd.ShowToolbar "Database",
acToolbarYes</FONT> <BR><FONT face=sans-serif size=2>DoCmd.ShowToolbar "Menu
Bar", acToolbarYes</FONT> <BR><BR><FONT face=sans-serif size=2>End Sub</FONT>
<BR><BR><FONT face=sans-serif size=2>Hope this helps</FONT> <BR><BR><BR><BR>
<TABLE width="100%">
<TBODY>
<TR vAlign=top>
<TD>
<TD><FONT face=sans-serif size=1><B>"Rocky Smolin - Beach Access
Software" <bchacc@san.rr.com></B></FONT> <BR><FONT face=sans-serif
size=1>Sent by: accessd-admin@databaseadvisors.com</FONT>
<P><FONT face=sans-serif size=1>01/29/2003 02:00 PM</FONT> <BR><FONT
face=sans-serif size=1>Please respond to accessd</FONT> <BR></P>
<TD><FONT face=Arial size=1> </FONT><BR><FONT
face=sans-serif size=1> To:
AccessD@databaseadvisors.com</FONT> <BR><FONT
face=sans-serif size=1> cc:
</FONT> <BR><FONT face=sans-serif size=1>
Subject: [AccessD] How To Stop
Printing</FONT></TR></TBODY></TABLE><BR><BR><BR><FONT face=Arial size=2>Dear
List:</FONT> <BR><FONT face="Times New Roman" size=3> </FONT> <BR><FONT
face=Arial size=2>I have a user who, instead of printing the report which is
attached to a button on a bound form, will hit the printer icon on the toolbar
or click File-->Print and, of course, gets 200+ pages because it's printing
all the records attached to the bound form. </FONT> <BR><FONT
face="Times New Roman" size=3> </FONT> <BR><FONT face=Arial size=2>He
admits it's a bonehead thing to do but wonders if there's a way to prevent him
from doing that (be serious, now).</FONT> <BR><FONT face="Times New Roman"
size=3> </FONT> <BR><FONT face=Arial size=2>Is there a way to stop
that?</FONT> <BR><FONT face="Times New Roman" size=3> </FONT> <BR><FONT
face=Arial size=2>MTIA</FONT> <BR><FONT face="Times New Roman"
size=3> </FONT> <BR><FONT face=Arial size=2>Rocky Smolin<BR>Beach Access
Software</FONT> <BR><FONT face="Times New Roman" size=3> </FONT>
<BR><BR></BLOCKQUOTE></BODY></HTML>