On a form used for editing records, after retrieving a record, some of the fields are set to enabled = false. After saving the record, I need to make sure all the fields on the form are set to enabled = true. I've written this code.
For Each ctl In Me.Controls
Debug.Print strGroup
If ctl.Tag = strGroup Then
Debug.Print ctl
ctl.Enabled = "True"
End If
Next ctl
When testing, it goes through the first control without any problem, when it reaches the second contol, after pressing F8 on the statement debug.print ctl, it immediately ends the function, and returns me to where the function call statement was made.
If the debug statement is not within the code, after pressing F8 on the statement ctl.Enabled = "True", it ends the function like above.