How to bold a subform header?

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

is there anyway to make the header titles in a subform Bold?
Any assistance is appreciated.
 
They are labels, so just change the appropriate properties. A neat piece of
code I just saw in the forms group allows to do font changes for all forms,
maybe you could adapt that.

Copied code below:

These 2 routines will set the font for all controls on a given form(s) to
the name you specify. To do all 50 of your forms, call
ChangeAllFormsCtrlsFont from the immediate window with the font you want as
the argument. ChangeFormCtrlsFont allows you to do an individual form.



Sub ChangeFormCtrlsFont(FormName As String, FontName As String)

Dim frm As Form
Dim varCtrl As Control

On Error Resume Next

DoCmd.OpenForm FormName, acDesign

For Each frm In Forms
If frm.Name = FormName Then
For Each varCtrl In frm.Controls
varCtrl.FontName = FontName
Next
End If
Next

End Sub

Sub ChangeAllFormsCtrlsFont(FontName As String)

Dim db As Database
Dim doc As Document
Dim cnt As Container
Dim frm As Form

On Error Resume Next

Set db = CurrentDb()
Set cnt = db.Containers("Forms")
For Each doc In cnt.Documents
DoCmd.OpenForm doc.Name, acDesign
For Each frm In Forms
If frm.Name = doc.Name Then
ChangeFormCtrlsFont frm.Name, FontName
End If
Next
DoCmd.Close acForm, doc.Name
Next

End Sub




--
Paul Overway
Logico Solutions, LLC
www.logico-solutions.com



--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Frank said:
In subform "datasheet view," how do you make the headers on the
datasheet view bold or change colors? Maybe Access doesn't allow
this??

Any comments most appreciated,


Not in Datasheet view, as far as I know. Try using Continuous Form
view instead. You can make it look like a data sheet but you get much
more flexibility and control.

hth

Hugh
 
Back
Top