Dynamic Font Specification

  • Thread starter Thread starter Jim Shaw
  • Start date Start date
J

Jim Shaw

Where, under which event, may I dynamically change the font specified for a
report element?

In production, my application needs to print bar codes using the 3 or 9
code. Under development, however, we want plain language to assure the
correct data is present. I'm hoping there's a way that I can go to one
place when we got to production and make the font changes with out having to
visit every report and form in the application to make the switch.

I'm thinking I can put the font name in a variable and then in the load
event for each report, do a 'mytextbox.FormName = VariableFontName' kind of
code. Then in one place I can set the variablefontName as needed. However,
attemtps to do this are not having any effect in the places I've tried.

Thanks for your help.
 
Jim said:
Where, under which event, may I dynamically change the font specified for a
report element?

In production, my application needs to print bar codes using the 3 or 9
code. Under development, however, we want plain language to assure the
correct data is present. I'm hoping there's a way that I can go to one
place when we got to production and make the font changes with out having to
visit every report and form in the application to make the switch.

I'm thinking I can put the font name in a variable and then in the load
event for each report, do a 'mytextbox.FormName = VariableFontName' kind of
code. Then in one place I can set the variablefontName as needed. However,
attemtps to do this are not having any effect in the places I've tried.


That idea should work. I would suggest using a field in a
little table to hold the font name. This way you would not
have to modify even one line of code, which would invoke a
recompile. You could use a DLookup in your startup form to
set the global variable or park the font name in a hidden
text box on an always open form. The latter is safer
because if won't be reset by an unhandled error (just in
case your error handling is not rock solid).

The code in each form/report's Open event would be like:

mytextboxA.FontName = VariableFontName
 
Back
Top