ACC2: Cannot Export Run Time Font Style Changes to RTFID: Q128389
|
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.
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:
Format: Currency
BorderStyle: Clear
FontUnderline: Yes
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
When Microsoft Access outputs data to an RTF file, it uses the first data record to determine the format for that section. If a control in the first record is underlined, that control is underlined for all subsequent records in the RTF file. Microsoft Access ignores any format changes after the first record.
Sub Detail1_Format (Cancel As Integer, FormatCount As Integer)
If [Employee Sales] > 50000 Then
Me![Employee Sales].fontunderline = True
Else [Employee Sales].fontunderline = False
End If
End Sub
For more information about the Output To command, search for "Output To" then "Output To Command (File Menu)" using the Microsoft Access Help menu.
Keywords : kbusage OtpRtf
Version : 2.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 9, 1999