Sub AA()
ChangeReportFont "rptOne", "Veranda"
ChangeReportFont "rptTwo", "Arial"
ChangeReportFont "rptThree", "Tahoma"
End Sub
Sub ChangeReportFont(ReportName As String, NewFontname As String)
Dim objX As AccessObject
Dim objCurProject As Object
Dim objCnt As Control
Dim objReport As Report
On Error Resume Next
Set objCurProject = Application.CurrentProject
For Each objX In objCurProject.AllReports
If objX.Name = ReportName Then
If Not objX.IsLoaded Then DoCmd.OpenReport objX.Name, acViewDesign
Set objReport = Application.Reports(objX.Name)
For Each objCnt In objReport.Controls
objCnt.FontName = NewFontname
Next
With DoCmd
.Save acReport, objX.Name
.Close
End With
End If
Next
End Sub
|