无法更改访问中的背景颜色
Posted
技术标签:
【中文标题】无法更改访问中的背景颜色【英文标题】:Can't change background color in access 【发布时间】:2016-08-17 17:28:43 【问题描述】:我已尝试对此进行多项更改,我正在尝试填充访问报告中空框的背景,但无法做到这一点。我的眼睛已经筋疲力尽,只是看不出我哪里出错了
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
On Len(Trim(Me![Text61])) = vbNullString GoTo color_box
Const WHITE = 16777215
Const GRAY = 14540253
If (Me![LineNum] Mod 2) = 0 Then
Me![Text60].BackColor = GRAY
Me![bmnh].BackColor = GRAY
Me![c_val].BackColor = GRAY
Me![Text61].BackColor = GRAY
Else
Me![Text60].BackColor = WHITE
Me![c_val].BackColor = WHITE
Me![Text61].BackColor = WHITE
Me![bmnh].BackColor = WHITE
End If
exit_here:
Exit Sub
color_box:
Me![Text61].BackColor = GRAY
Resume exit_here
End Sub
【问题讨论】:
【参考方案1】:试一试,你已经很接近了。
Const WHITE = 16777215
Const GRAY = 14540253
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Len(Trim(Me![Text61])) = 0 Then GoTo color_box
If (Me![LineNum] Mod 2) = 0 Then
Me![Text60].BackColor = GRAY
Me![bmnh].BackColor = GRAY
Me![c_val].BackColor = GRAY
Me![Text61].BackColor = GRAY
Else
Me![Text60].BackColor = WHITE
Me![c_val].BackColor = WHITE
Me![Text61].BackColor = WHITE
Me![bmnh].BackColor = WHITE
End If
exit_here:
Exit Sub
color_box:
Me![Text61].BackColor = GRAY
End Sub
【讨论】:
以上是关于无法更改访问中的背景颜色的主要内容,如果未能解决你的问题,请参考以下文章
如何根据Angularjs中的背景颜色自动更改文本颜色? [复制]
UITableViewHeaderFooterView:无法更改背景颜色