variable font size

C

Chuck

Can I set the size of a control in a report depending on the length of the data
in that control?

Control name is Text1

This is what I,m trying to do. However, this code in the report module does
not work.

iif len(me.[Text1]>20, fontsize me.[Text1]=10, fontsize me.[Text1]=11

Chuck
 
L

Larry Linson

Chuck said:
Can I set the size of a control in a report
depending on the length of the data
in that control?

Control name is Text1

This is what I,m trying to do. However, this code in the report module does
not work.

iif len(me.[Text1]>20, fontsize me.[Text1]=10, fontsize me.[Text1]=11

Try this

Me!Text1.FontSize = IIf(Len(Me!1ext1) > 20, 10, 18)

For this example, I used font sizes that are sufficiently different that
it'll be obvious if it is working... you can, of course, once you verify
that it works, change them to the sizes you prefer.

IIf returns a value; it does not execute a statement; and, in any case,
FontSize is a property of the control not an executable statement. How did
you come up with that code, anyway?

Larry Linson
Microsoft Office Access MVP
 
C

Chuck

Chuck said:
Can I set the size of a control in a report
depending on the length of the data
in that control?

Control name is Text1

This is what I,m trying to do. However, this code in the report module does
not work.

iif len(me.[Text1]>20, fontsize me.[Text1]=10, fontsize me.[Text1]=11

Try this

Me!Text1.FontSize = IIf(Len(Me!1ext1) > 20, 10, 18)

For this example, I used font sizes that are sufficiently different that
it'll be obvious if it is working... you can, of course, once you verify
that it works, change them to the sizes you prefer.

IIf returns a value; it does not execute a statement; and, in any case,
FontSize is a property of the control not an executable statement. How did
you come up with that code, anyway?

Larry Linson
Microsoft Office Access MVP
Syntax syntax syntax
Thank you Larry.

Chuck
--
 

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