You miscopied that line, there's supposed to be an = in
there.
OTOH, I only partially generalized the code for multiple
groups. It won't make any difference in your specific
question, but I meant to write:
If ctl.Tag Like "*" & GroupID & "*" Then
The procedure just loops through all the controls on the
form looking for ones that have LOCK in its Tag property.
When such a control is found, it either locks or unlocks it
depending on the value in the OnOff argument.
The procedure could be done more quickly (if the form has a
lot of controls) by populating a private collection in the
form's Load event. The procedure can then loop through the
controls in the private collection without wasting time
checking all the controls. Just log this last bit in the
back of your mind in case you notice a delay in when
navigating in the form.
--
Marsh
MVP [MS Access]
I tried to do what you told me and the debugger didn't like this line,
ctl.Lock OnOff.
Also I understand what the end result of this code is going to be. But I
would like to understand what each part of the code is doing. So I can start
learning this language.