I have a year on year report and need certain years to tando out depending on the value of a field. My idea was to set an event prcedure on the report opening and setting the various fields with the following.
if me.year = "2007" then
me.year.fontbold = True
me.year.fontsize = "10"
me.year.textalign = "Center"
I have tried this and varying other similar setups but no joy, any help would be great.
- Use the Conditional Formating of the text boxes (Menu Format --> Conditional Formating).
- Use the Format property of the Detail section of the report (Properties --> On Format):
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Customer_Name.BackStyle = 1 ' default = 0 transparent
If Me.Customer_Name = "Toyota" Then
Me.Customer_Name.BackColor = vbRed
Me.Customer_Name.BackColor = vbWhite
The second solution is probably more appropriated in your case.