>>Is there a way programmatically to know how many objects are open on a form?
>>
>>I have a form with six check boxes on it, and as they're named "Check1", "Check2", etc., I run a loop to pull their values for further processing.
>>
>>In the near future, we'll add about four more checks, and an unknown number after that. Currently, all I have to do is add the new object and change the parameters of the loop, but I'd like to be able to simply add the object and let the program do the counting.
>>
>>Is there a way to determine within the program how many objects named "Check" are on the form and run the loop dynamically?
>>
>>In a similar vein, is it possible to add check boxes dynamically based on data in a table?
>
>One approach could be to loop the Controls collection of the form and check the class property of each object to see if it's = 'CheckBox':
>
For Each oCtl In Thisform.Controls
> If oCtl.Class = 'Checkbox' Then
> myCounter = myCounter + 1
> Endif
>Next
>
>HTH
Actually, it's the Controls array, not collection. But you can still treat it as a collection as far as For Each.. Next goes.