Hidden text boxes are printing when they shouldn't

N

Nick

I have some controls on a report(labels and text boxes)
that are conditionally hidden using code. They are indeed
hidden when the report is viewed (in print preview) on the
screen, but they reappear when the report is actually
printed.
Thanks in advance to anyone who can help.
 
G

Guest

Sure,
The same code runs on two events- On Activate and On Page.
I should also mention that the formatting (when printed)
seems to vary on different printers. This leads me to
believe that the application is not at fault but perhaps
the printers are.

Anyway, here is the code;

Private Sub Report_Activate()
On Error GoTo except

Dim sngpercent As Double

DoCmd.Maximize
sngpercent = Me.PercentageShare

If sngpercent = 1 Then

'MsgBox "full share"
lblpercentageShare.Visible = False
PercentageShare.Visible = False
lblsplitP_LAUD.Visible = False
SplitP_L_AUD_.Visible = False

Else: 'MsgBox "part share"

Me.txtcomment.Top = 5450
lblpercentageShare.Visible = True
PercentageShare.Visible = True
lblsplitP_LAUD.Visible = True
SplitP_L_AUD_.Visible = True

End If
Exit Sub
except: MsgBox Err.Description
End Sub
 
D

Duane Hookom

There is no Activate event when printing to a printer. Your code should be
in the On Format event of the section containing the controls.
 

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