How to change the backcolor of a subform section (acheader)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This code for a single form works
Forms("PLANNING_PO_SF").Section(acHeader).BackColor = vbBlue

whats the code ,when I want to change the color of the acheader in a subform ?
I try this code ,but it didn't works

Set frm = Application.Forms("PLANNING_ONDERHOUD_OVERZICHT")
With frm
.Controls("Planning_PO_SF").Section(acHeader).BackColor =vbBlue
End With
 
Provided that "Planning_PO_SF" is the name of the SubformCONTROL, your code
should work.

Note that the name of the SubformControl may be different from the name of
the Form being used as the Subform (more technically accurate, being used as
the SourceObject of the SubformControl).

(Of course, the Form/Subform must be open when the code is executed).
 
the name of the SubformControl is "Planning_PO_SF".
I've RunTime error:451
"Property Let procedure not defined and
property Get procedure did not return an object"
 
Works fine for me. Here is the code I tested (A2002):

Forms!Form5!dbo_tblTest1.Form.Section(acHeader).BackColor = vbBlue

Try without the qualifier "Application".
 
This code works,

Thanks a lot.

Van T. Dinh said:
Works fine for me. Here is the code I tested (A2002):

Forms!Form5!dbo_tblTest1.Form.Section(acHeader).BackColor = vbBlue

Try without the qualifier "Application".
 
Back
Top