ACC2: Cannot Export Run Time Font Style Changes to RTF (128389)
The information in this article applies to:
This article was previously published under Q128389 SYMPTOMS
When you conditionally set the font styles for a report's controls using a
section's OnFormat property, the changes are lost when you choose the
Output To command to save the report as a Rich Text Format (RTF) file. For
example, if you change a control's FontUnderline, FontItalics, or
FontWeight property at run time, the change does not appear when you output
the report to an RTF file.
RESOLUTION
To work around this behavior, you can use the following steps to stack two
bound controls (one with font styles and one without font styles) on each
other, and set the Visible property to specify which control is displayed
at run time:
- Open the sample database NWIND.MDB.
- Make a copy of the Employee Sales Subreport report, and name it
RTF_FIX.
- Open the RTF_FIX report in Design view.
- If the field list is not displayed, choose Field List from the View
menu. Drag the Employee Sales field from the field list so that it is
on top of the existing Employee Sales control in the detail section.
This new control has the name Field6 by default.
- Delete the label associated with the Field6 control.
- Set the following properties for the Field6 field:
Format: Currency
BorderStyle: Clear
FontUnderline: Yes
NOTE: This example sets only the FontUnderline property. To set the
FontItalics or FontWeight properties, repeat the steps above for those
properties.
- Set the detail section's OnFormat property to the following event
procedure:
Sub Detail1_Format (Cancel As Integer, FormatCount As Integer)
If [Employee Sales] > 50000 Then
Me![Field6].visible = -1
Me![Employee Sales].visible = 0
Else
Me![Field6].visible = 0
Me![Employee Sales].visible = -1
End If
End Sub
- From the File menu, choose Print Preview. Note that sales that are
greater than $50,000 are underlined.
- From the File menu, choose the Output To command.
- In the Select Format list box, select Rich Text Format (*.rtf), and
then choose the OK button.
- In the File Name box, type the filename TESTFIX.RTF,
and then choose OK.
- Open the TESTFIX.RTF file in a word processor (such as Microsoft Word
for Windows) that supports the RTF format. Note that sales amounts
exceeding $50,000 are underlined.
REFERENCES
For more information about the Output To command, search for "Output To"
then "Output To Command (File Menu)" using the Microsoft Access Help
menu.
Modification Type: | Major | Last Reviewed: | 11/6/2000 |
---|
Keywords: | kbprb kbusage KB128389 |
---|
|