Change a labels property at run time?

P

Patrick Hill

I what to change a labels size and color depending on the
value of a field.
In the reports OnOpen event (and every event) I have

=Reports!Test1.Label6.FontSize=6

but Label6 stays at the design font size of 22.

How do I changing a labels property at run time?

Thanks
Patrick
 
F

Fredg

Patrick,
In the Open event, all you need is:
[Label6].FontSize = 6

If there is some criteria involved to change sizes, then
use the Format event where the label is located:

If [SomeField] = something Then
[Label6].FontSize = 6
Else
[Label6].FontSize = 22
End If

If there is no criteria, why not just change it in design view
and be done with it?
 
P

Patrick Hill

Fred,
The answer is that it must be in an [Event Procedure] to work built with the
"Expression Builder", not built using the "Code Builder"!
Thanks for the lead. (BTY I am going to use a criteria)
Patrick
 

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