P
PC User
Part of my code works, but recently I wanted to change more report
properties. Access 2007 doesn't have a lot of explaination of the use
of properties. This is my "change properties of all reports" code:
=================================
Public Function ChangeReports()
Dim db As Database, c As Container, d As Document, r As Report
Set db = CurrentDb
Set c = db.Containers("Reports")
For Each d In c.Documents
DoCmd.OpenReport d.NAME, acViewDesign
Set r = Reports(d.NAME)
r.DefaultView = 1
r.PopUp = True
'r.PageHeaderSection.BackColor = RGB(255, 255, 255)
'r.Detail.BackColor = RGB(255, 255, 255)
'r.PageFooterSection.BackColor = RGB(255, 255, 255)
'r.Picture = (none)
DoCmd.Close acReport, d.NAME, acSaveYes
Next d
End Function
=================================
The lines that I made into comments get errors; so there must be some
better way of writing these code lines. Has anyone done this before?
Thanks,
PC
properties. Access 2007 doesn't have a lot of explaination of the use
of properties. This is my "change properties of all reports" code:
=================================
Public Function ChangeReports()
Dim db As Database, c As Container, d As Document, r As Report
Set db = CurrentDb
Set c = db.Containers("Reports")
For Each d In c.Documents
DoCmd.OpenReport d.NAME, acViewDesign
Set r = Reports(d.NAME)
r.DefaultView = 1
r.PopUp = True
'r.PageHeaderSection.BackColor = RGB(255, 255, 255)
'r.Detail.BackColor = RGB(255, 255, 255)
'r.PageFooterSection.BackColor = RGB(255, 255, 255)
'r.Picture = (none)
DoCmd.Close acReport, d.NAME, acSaveYes
Next d
End Function
=================================
The lines that I made into comments get errors; so there must be some
better way of writing these code lines. Has anyone done this before?
Thanks,
PC