Conditional formatting of reports using VB

  • Thread starter Thread starter Joan in Syracuse
  • Start date Start date
J

Joan in Syracuse

Is it possible to use VB to do conditional formatting for
a report?

If fiedname= fieldname (C=PART_NUM+ I want the line style
to be solid.
If fieldname is true (C2300 = "-1") I want the field to be
grey. ( or red...)

Thanks for any input.
 
Joan said:
Is it possible to use VB to do conditional formatting for
a report?

If fiedname= fieldname (C=PART_NUM+ I want the line style
to be solid.
If fieldname is true (C2300 = "-1") I want the field to be
grey. ( or red...)

I'm not sure I understand your If conditions, but maybe you
want something like:

If PART_NUM = "C" Then
textbox.BorderStyle = 1 'solid
Ense
textbox.BorderStyle = 3 'dashes
End If

If C2300 = True Then
textbox.BackColor = vbRed
Else
textbox.BackColor = vbWhite
End If
 
-----Original Message-----


I'm not sure I understand your If conditions, but maybe you
want something like:

If PART_NUM = "C" Then
textbox.BorderStyle = 1 'solid
Ense
textbox.BorderStyle = 3 'dashes
End If

If C2300 = True Then
textbox.BackColor = vbRed
Else
textbox.BackColor = vbWhite
End If
Thanks for the info. I I may, I have a couple of more
questins. Do I set this up as an event procedure for the
report or as a function? If it is set up as a function,
how do I get it connected to the report? Thanks in
advance.
 
-----Original Message-----
Thanks for the info. I I may, I have a couple of more
questins. Do I set this up as an event procedure for the
report or as a function? If it is set up as a function,
how do I get it connected to the report?


Use the event procedures. Even if you want to place it in a
separate procedure, you would call it from an event
procedure.

The kind of code above should be in the Format event of the
section containing the text box with the properties you're
setting.
 
Back
Top