|
例如想通过一个数组变量引用多个控件名称的时候,代码应该怎么写?
下面是错误的代码,版主帮忙看看正确的应该是怎么写的。
Dim arrP()
arrP = Array("Trap1", "Cal1")
sMax = DLookup("Max", "spec", "n= '18882222' And Parameter = '& arrP(0) &'")
sMin = DLookup("Min", "spec", "n= '18882222' And Parameter = '& arrP(0) &'")
Set objFrc = Me.arrP(0).FormatConditions.Add(acFieldValue, acGreaterThan, sMax)
Me.arrP(0).FormatConditions(0).BackColor = 255
Set objFrc = Me.arrP(0).FormatConditions.Add(acFieldValue, acLessThan, sMin)
Me.arrP(0).FormatConditions(1).BackColor = 255
Set objFrc = Me.arrP(1).FormatConditions.Add(acFieldValue, acEqual, "OK")
Me.arrP(1).FormatConditions(0).BackColor = 255
|
|