oCollector = NewObject('udfobjcollector','mycollector.prg') With oCollector .FillCollection(thisform) If type(".aCollection[1]") = "L" * No members Return .f. Endif For each oObject in .aCollection With oObject If upper(.Baseclass)='TEXTBOX' and empty(.Value) .SetFocus() oCollector.ResetCollection() exit Endif Endwith Endfor Endwith *myCollector.prg Define CLASS udfobjcollector AS relation Name = "udfobjcollector" Dimension acollection[1] *-- Method to fill collection array aCollection with members of all contained objects Procedure fillcollection Lparameters oContainerObject Local ix, nMembers, lnExpand, oObjectRef, aContainerObjects[1] nMembers = amembers(aContainerObjects, oContainerObject,2) With this For ix = 1 to nMembers && Start collecting lnExpand = iif(type(".aCollection[1]")= "L",0,1) Dimension .acollection[alen(.aCollection,1)+lnExpand] oObjectRef = eval("oContainerObject."+aContainerObjects[ix]) .acollection[alen(.aCollection,1)] = oObjectRef .fillcollection(oObjectRef) && Recurse Endfor Endwith Endproc *-- Release object references when done with aCollection array Procedure resetcollection This.acollection=.f. && Release Object References Dimension this.acollection[1] Endproc EnddefineCetin