Loop through all Microsoft Access reports and convert the font name to HelveticaNeueLT Std for all labels and text?

Please help me loop through all Microsoft Access 2003 reports and change the font name of any text boxes/labels to HelveticaNeueLT Std...  Thank you very much in advanced.

Private Sub Change_Font_AllReports()

Dim aob As AccessObject
'do the following command
'to keep the saving report question
'from always asking when it is closed.
DoCmd.SetWarnings False
For Each aob In CurrentProject.AllReports
    'aob.Name
    DoCmd.OpenReport aob.Name, acViewDesign, , , acHidden
    'code needed here...
    'loop through all text boxes/queries... change font to HelveticaNeueLT Std
    '
    '
    DoCmd.Save acReport, aob.Name
    DoCmd.Close acReport, aob.Name
Next

End Sub
LVL 1
stephenlecomptejrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TextReportCommented:
The function below works for me.
Cheers, Andrew
Function ChangeReportFont()
Dim ctl As Control
Dim rpt As Report
Dim db As Database
Dim cont As Container
Dim doc As Document
 
Const conFontName = "HelveticaNeueLT Std"
 
    Set db = CurrentDb()
    Set cont = db.Containers("Reports")
    
    For Each doc In cont.Documents
        DoCmd.OpenReport doc.Name, acViewDesign
        Set rpt = Reports(doc.Name)
        
        For Each ctl In rpt.Controls
            If TypeOf ctl Is ComboBox Or TypeOf ctl Is ListBox Or TypeOf ctl Is TextBox Or TypeOf ctl Is Label Then
               ctl.FontName = conFontName
            End If
        Next ctl
            
        DoCmd.Close acReport, rpt.Name, acSavePrompt
    
    Next doc
End Function

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stephenlecomptejrAuthor Commented:
Simply thank you!
0
TextReportCommented:
Forgot to change the Save to yes rather than prompt

DoCmd.Close acReport, rpt.Name, acSavePrompt

Cheers, Andrew
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.