Hey all,
I'm writing an application that automatically adds code, events and formats the controls on a form.
Basically I'm looping through all the controls like this:
For Each ctr in frm.Controls
Loop
I also tried:
For i = 0 to frm.Controls.Count -1
Set ctr = frm.controls.item(i)
Next
The issue I'm having is that it is processing the same control several times and when a control is being processed for the second time, another control is being skipped.
What happens is that a control at for example index 4 is processed, then it reappears at index 24. At that point the control at index 4 is another one.
I assume this happens because the controls are renamed and then the form control indexes are rearranged.
Anyone knows a workaround or know more about the reindexing?
I'm writing an application that automatically adds code, events and formats the controls on a form.
Basically I'm looping through all the controls like this:
For Each ctr in frm.Controls
Loop
I also tried:
For i = 0 to frm.Controls.Count -1
Set ctr = frm.controls.item(i)
Next
The issue I'm having is that it is processing the same control several times and when a control is being processed for the second time, another control is being skipped.
What happens is that a control at for example index 4 is processed, then it reappears at index 24. At that point the control at index 4 is another one.
I assume this happens because the controls are renamed and then the form control indexes are rearranged.
Anyone knows a workaround or know more about the reindexing?