Marchese Il Chihuahua
Marchese Il Chihuahua

Reputation: 1129

How to perform font changes to a report using an option box

I am having issues trying to use an option box to change a font on a series of controls. Basically, I have a report (named Q_tblProject52Week) embedded in a form. I have embedded an option box within the form (called "cornice33) which aims to change the font on the two controls (testo107 and testo108) embedded in the report.

At the moment I am trying the following with no success:

If Cornice33 = 1 Then

    testo107.FontName = "calibri"
    testo108.FontName = "times"

ElseIf Cornice33 = 2 Then

    testo107.FontName = "times"
    testo108.FontName = "calibri"

End If

I am getting a missing object message (it is not recognising the controls testo107 and testo108). Also important to note, the report is embedded in a folder control.

Upvotes: 0

Views: 39

Answers (1)

Pupa Rebbe
Pupa Rebbe

Reputation: 528

You need to tell access that you refer to a control on the report which is a child of your form.

If Cornice33 = 1 Then

    Me.Q_tblProject52Week.testo107.FontName = "calibri"
    Me.Q_tblProject52Week.testo108.FontName = "times"

ElseIf Cornice33 = 2 Then

    Me.Q_tblProject52Week.testo107.FontName = "times"
    Me.Q_tblProject52Week.testo108.FontName = "calibri"

End If

hope this helps

Upvotes: 2

Related Questions