Formatting text on a Report

  • Thread starter Thread starter Kedd123
  • Start date Start date
K

Kedd123

Does anyone see a problem with the following code? It does not do anything
(and there are no error messages). I am trying to turn the text under the
cloumn heading bold. The field name is LoginLot. There is no conditional
formatting and the report is based on a query.

Private Sub CommandPrintLogin_Click()
On Error GoTo Err_CommandPrintLogin_Click

Dim stDocName As String

stDocName = "QueryLoginrEPORT"
DoCmd.OpenReport stDocName, acViewPreview

Reports!queryloginreport!LoginLot.FontBold = True

Exit_CommandPrintLogin_Click:
Exit Sub

Err_CommandPrintLogin_Click:
MsgBox Err.Description
Resume Exit_CommandPrintLogin_Click

End Sub
 
Hi Kedd123,

Add this statement in the on open event of your report
LoginLot.FontBold = True

and remove this from the code you posted
Reports!queryloginreport!LoginLot.FontBold = True

HTH Paolo
 
There's a timing problem.

The report is already formatted (at least partly) before the code runs.

Just open the report in design view and save it with the text box set to
bold.

Alternatively use the report's Open event to set the property of the
control.
 
Thank you for your help!

Allen Browne said:
There's a timing problem.

The report is already formatted (at least partly) before the code runs.

Just open the report in design view and save it with the text box set to
bold.

Alternatively use the report's Open event to set the property of the
control.
 
Back
Top