Change Font to Bold

  • Thread starter Thread starter es
  • Start date Start date
E

es

I have the following code in the format event but it does
not change the font.

if me.field1 = "First" then
me.field1.fontbold = true
else
me.field1.fontbold = false
end if


Thanks!
 
What section is the control and the code? Do you have a control named
"field1"? If this code was copied and pasted from your module, I would
expect to see Me with an uppercase "M" as well as other characters in
uppercase. What's up with that?
 
it is just typed in this message by hand.
the control is in the detail section and that is where
the code is also (in the on format event)
 
it is just typed in this message by hand.
the control is in the detail section and that is where
the code is also (in the on format event)

Have you stepped through the code a line at a time? The first thing to do
in situations like this is to see if the If-Then block is being evaluated
the way you expect.

My guess is that Field1 is not equal to "First" when you think it is.
 
it is just typed in this message by hand.
the control is in the detail section and that is where
the code is also (in the on format event)

What happens if you change the code to:
Me![Field1].FontBold = Me![Field1] = "First"

Change [Field1] to the actual name of the control.
 
Back
Top