Hiding controls on reports in Access

D

dusrtcat

I am trying to achieve the following on a report to change report headers to
certain values and hide or show certain controls, only with partial
success... see code

Any pointers



Option Compare Database
Dim Copies As Integer

Private Sub PageHeader0_Print(cancel As Integer, PrintCount As Integer)

Select Case Copies
Case 1
[texttype].Caption = "Delivery Note"
[Projamt].Visible = False
Case 2
[texttype].Caption = "Customer Copy"
[Projamt].Visible = False
Case 3
[texttype].Caption = "Office Copy"
[Projamt].Visible = True

End Select
If Page = Pages Then Copies = Copies + 1

End Sub



Private Sub Report_open(cancel As Integer)
Copies = 1
End Sub
 
S

strive4peace

try using the Format event instead of the Print event

Warm Regards,
Crystal
Microsoft Access MVP 2006

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)
 
Top