Viewable on Screen but Non-Printing

B

bhjohnso

I've a collection of objects and labels I want to hide for printing
but keep them visable for screen viewing on an Access 2003 report. The
data is important for internal use, but not external use. We're
wanting to refrain from duplicate reports. Properties are failing me.
Can someone please give advice?

Heather
 
F

fredg

I've a collection of objects and labels I want to hide for printing
but keep them visable for screen viewing on an Access 2003 report. The
data is important for internal use, but not external use. We're
wanting to refrain from duplicate reports. Properties are failing me.
Can someone please give advice?

Heather

You can take advantage of the fact that a report's Activate event only
fires if/when a report is previewed.

The actual starting value of intPreview depends upon if you have a
control in the report to compute [pages].

Option Compare Database
Option Explicit
Dim intPreview As Integer

Private Sub Report_Activate()
intPreview = -1 ' If [Pages] is NOT used
' intPreview = -2 ' If [Pages] used
End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
If intPreview = 0 Then
' Set the Visible property of all controls you do not wish to print
to False here.
Me.Control1.Visible = False
Me.Control2.Visible = False
End If

intPreview = intPreview + 1
End Sub

The Control1 and Control2 will only appear during report preview.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top