D
dch3
I'm able to successfully create format conditions via code, while I'm able to
manipulate the format of the control (.enabled, .forecolor, .backcolor), is
it possible to control wether or not the field is visible or locked.
For i = 0 To Me.subfrmLoadListDetail.Controls.Count - 1
Set ctl = Me.subfrmLoadListDetail.Controls(i)
With ctl
If .Tag Like "*" & "loadListDetail" & "*" Then
For j = 0 To .FormatConditions.Count - 1
Debug.Print j, .Name, .FormatConditions.Count,
..FormatConditions(j).Expression1
Next j
'Delete all formatConditions by deleting the formatCondition
with the index of (0), .Delete will shift all of the formatConditions
'by a factor of 1 each time it is executed, so we have to
adjust accordingly throughout the loop. Using index(0) is the easiest
'way to adjust for the diminishing number of formatConditions
For j = 0 To .FormatConditions.Count - 1
.FormatConditions(0).Delete
Next j
'Disable if the record was entered via the manifest
Set newCondition = .FormatConditions.Add(acExpression, ,
"[Forms]![frmLoadList]!subfrmLoadListDetail.form!txtEntryMethod =
'Manifest'", "")
With newCondition
.Enabled = False
.BackColor = 12632256
End With
End If
End With
Next i
manipulate the format of the control (.enabled, .forecolor, .backcolor), is
it possible to control wether or not the field is visible or locked.
For i = 0 To Me.subfrmLoadListDetail.Controls.Count - 1
Set ctl = Me.subfrmLoadListDetail.Controls(i)
With ctl
If .Tag Like "*" & "loadListDetail" & "*" Then
For j = 0 To .FormatConditions.Count - 1
Debug.Print j, .Name, .FormatConditions.Count,
..FormatConditions(j).Expression1
Next j
'Delete all formatConditions by deleting the formatCondition
with the index of (0), .Delete will shift all of the formatConditions
'by a factor of 1 each time it is executed, so we have to
adjust accordingly throughout the loop. Using index(0) is the easiest
'way to adjust for the diminishing number of formatConditions
For j = 0 To .FormatConditions.Count - 1
.FormatConditions(0).Delete
Next j
'Disable if the record was entered via the manifest
Set newCondition = .FormatConditions.Add(acExpression, ,
"[Forms]![frmLoadList]!subfrmLoadListDetail.form!txtEntryMethod =
'Manifest'", "")
With newCondition
.Enabled = False
.BackColor = 12632256
End With
End If
End With
Next i