开发者

vba access: each Ctl in report.controls

i need all the rectangles on my form to be red when the report opens. how do i do this?

here's my code:

Private Sub Report_Load()
    For Each ctl In fill_boxes.Controls
            If ctl开发者_StackOverflow.Name = acRectangle Then
                ctl.Name.BackColor = "#ED1C24"
            End If
    Next ctl
End Sub

i get an error OBJECT REQUIRED on this line: For Each ctl In fill_boxes.Controls

fill_boxes is the name of the report

how do i tweak the code to make all rectangles red on report open/?


Is the BackStyle on the rectangle set to Transparent or Normal - Normal is what you want to be if you want to colour the contents of it.

ctl.Name.BackStyle = Normal
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜