I don't believe every control has a Tag property. You'll have to put in
error trapping to determine which control(s) cause the error, and ensure
that you don't look at the Tag property for those controls. (Look at the
ControlType property if you need to eliminate certain controls)

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
>I don't believe every control has a Tag property. You'll have to put in
>error trapping to determine which control(s) cause the error, and ensure
>that you don't look at the Tag property for those controls. (Look at the
>ControlType property if you need to eliminate certain controls)
I think all the Access controls have the Tag property,
though some ActiveX controls might not.
However, there are some controls that do not have a Locked
(e.g. label) or ForeColor (e.g. checkbox) property.
If a control does not have the Locked property, it should
not be included in the set of controls with "LOCK" in the
Tag property.
An alternative is to use different values in the Tag
property. E,g, "LOCK" for controls that need to be locked
and "FORE" for controls that need to change color. For
those controls that need both, set their Tag to "LOCK;FORE"
The code could then look like:
For Each ctl In Me.Controls
If ctl.Tag Like "*LOCK*" Then
ctl.Locked = Me.EDI_Complete
End If
If ctl.Tag Like "*FORE*" Then
If Me.EDI_Complete = True Then
ctl.ForeColor = vbBlue
Else
ctl.ForeColor = vbGreen
End If
End If
Error handling is a good idea regardless of how the problem
is addressed.

Signature
Marsh
MVP [MS Access]
Douglas J. Steele - 19 Nov 2006 12:59 GMT
>>I don't believe every control has a Tag property. You'll have to put in
>>error trapping to determine which control(s) cause the error, and ensure
[quoted text clipped - 31 lines]
> Error handling is a good idea regardless of how the problem
> is addressed.
Yeah, I believe you're correct, Marsh.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
mattc66 - 20 Nov 2006 18:01 GMT
That works thanks - How would I lock a subform?
>>I don't believe every control has a Tag property. You'll have to put in
>>error trapping to determine which control(s) cause the error, and ensure
[quoted text clipped - 31 lines]
>Error handling is a good idea regardless of how the problem
>is addressed.

Signature
Matt Campbell
mattc (at) saunatec [dot] com
Marshall Barton - 26 Nov 2006 23:52 GMT
You can lock the entire subform by locking the subform
control.

Signature
Marsh
MVP [MS Access]
>That works thanks - How would I lock a subform?
>
[quoted text clipped - 33 lines]
>>Error handling is a good idea regardless of how the problem
>>is addressed.