Change Font to Bold

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!
 
D

Duane Hookom

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?
 
G

Guest

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)
 
R

Rick Brandt

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.
 
F

fredg

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top