variable font size

  • Thread starter Thread starter Chuck
  • Start date Start date
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
 
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
 
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
--
 
Back
Top