开发者

background color problem in an access form

I have a form containing a textbox "Text20". I have put some code in the OnCurrent event of the form:

Option Compare Database

Private Sub Form_Curr开发者_JAVA百科ent()
Text20.BackColor = vbRed
End Sub

It does nothing when I display the form whereas it should color my textbox. Do you see why ?

Thank you


There really is no reason to do this in the code behind. Just right click the control, select conditional formatting and apply the formatting and give it a condition and a format.

No code required.

background color problem in an access form

In fact, the code you included in your example would re-set that every time the form changes records, which is overkill anyway.

Better yet. Why not just set the color in the property sheet for the control?

background color problem in an access form

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜