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

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
 
V

Van T. Dinh

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).
 
G

Guest

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"
 
V

Van T. Dinh

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".
 
G

Guest

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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top