Since it is a datasheet you can use Conditional Formatting to accomplish
what you need. Click into SumOfMes1 in datasheet view (not design view),
then click Format > Conditional Formatting. Select "Expression is", and in
the box to the right of that selection put:
[CodigoRubrica]="TOTAL"
Select the icon for bold font.
There are some techniques for more complex formatting using code (changing
the row color, for instance) in a continuous form (I'm not sure about
datasheet view, but you can format a continuous form to look like a
datasheet), but it sounds as if Conditional Formatting, which is simpler to
implement, will do what you need.
Note that you would need to use the same technique for a Continuous form.
You can use code as you have done in a Single form, although the Load event
is not a good choice. Even if it works at all it will not alter the result
from record to record; the initial formatting will apply to all records.
Try the Current event. Also, it is best if you give the text box a
different name than the field, if it is not already.
Note also that if you are using code you need to set FontBold to False if it
fails the logical test, or else it will remain bold once it has been
formatted that way:
If Me.CodigoRubrica = "TOTAL" Then
Me.SumOfMes1.FontBold = True
Else
Me.SumOfMes1.FontBold = False
End If
Marco said:
Hi.
it doesn't work.
Any ideas?
Marco
Mark A. Sam said:
Use a number from 0-8 to designate the Font Weight like:
[SumOfMes1].FontBold = 6
God Bless,
Mark A. Sam
Marco said:
Hi,
I put the following comand in forms load property to set some bolds
and
is
not working:
If Me.CodigoRubrica = "TOTAL" Then
Me.SumOfMes1.FontBold = True
End If
This form as a datasheet view, view.
Can you help??
regards,
Marco