Below is the algorithm I require. I am not very familiar with the VBA syntax required to make this algorithm work.
The purpose of the algorithm is to add underline to conditional formatting when the report is in Report View to mimic a hyperlink and to remove the underline when the report is in Print Preview.
The purpose of the algorithm is to add underline to conditional formatting when the report is in Report View to mimic a hyperlink and to remove the underline when the report is in Print Preview.
Code:
'Example Call
Call UnderlineCondFormat(Reports("myReport"), acViewPreview)
Public Sub UnderlineCondFormat(rpt As Report, intReportView As Integer)
'Cycle through each section of the report.
'Cycle through each control in the section.
'If the control is a subReport recursive call to UnderlineCondFormat
UnderlineCondFormat(ctrl.Report, intReportView)
Else
If the ctrl has Tag = "Conditional HyperLink"
Cycle through all the conditional formatting
If intReportView = acViewPreview
Remove underline from the conditional format.
Else 'acViewReport
Add underline to the conditional format.
End If
Loop
End If
End If
Loop
Loop
End Sub
Last edited: