北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |
问题描述:
"记录条数"处文本框 属性(可用、是否锁定)设置失效 (正常情况 可用 为“否”,是否锁定 为“是”时,文本框是不能获得焦点)
现在文本框可以获得焦点,背景色及字体颜色随着点选某行数据跟着变色,求帮忙解决一下这一问题。
如果可能请帮忙注 一下代码的意思万分感谢!
Function test(ByVal A As String)
Dim ctl As Control
For Each ctl In Me.Form
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
ctl.FormatConditions(0).Modify acExpression, , "[ID] ='" & A & "'"
End If
Next ctl
End Function
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Me.Form
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
ctl.FormatConditions.Add acExpression, acEqual, 1
ctl.FormatConditions(0).Modify acExpression, , "[ID] ='-1'" '
ctl.FormatConditions(0).ForeColor = RGB(0, 112, 255)
ctl.FormatConditions(0).FontBold = True
ctl.FormatConditions(0).BackColor = RGB(255, 0, 255)
ctl.OnGotFocus = "=test([ID])"
End If
Next ctl
End Sub