You are here:

Using MS Access/Access 2007 Report Font Size

Advertisement


Question
QUESTION: Access 2007 Report:  Used conditional formatting to change the font color, however, I also need to increase the font size which cannot be done using conditional formatting.

I tried the following Event On Format in vba but it is not working, suggestions:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If [Basket] = "Yes" Then
        
        
        Me.Auction_Item_Name.FontSize = 18

End Sub

ANSWER: The On Format event will only apply when you preview the report in Print Preview mode. If you want it to Print you need to ALSO use the On Print event.

Also is Basket a text datatype or a Yes/No datatype?

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

---------- FOLLOW-UP ----------

QUESTION: The Basket is yes/no datatype

Answer
Then you need to use:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If [Basket] = True Then   
       
       Me.Auction_Item_Name.FontSize = 18

End Sub

A Yes/No datatype contains a value of 0 or -1. You were testing for a text string which won't work. Yoo can use any of the following:

If [Basket] = True Then
If [Basket] = Yes Then
If [Basket] = On Then
If [Basket] = -1 Then
If [Basket] Then

Any of the above will work.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.