Nadya,
Are you adding object references to the collection? Or the name that can be EVALUATED() to reference the control? You have a few different options depending on what and how you are storing the data. I'm not real clear on what you are trying to achieve. One option would be to use something like tN (where t is a prefix letter and N is the TabOrder) as the cKey and then set the KeySort property of your collection to 2 (Key ascending). Then, when you iterate through the collection it would be in TabOrder. Another option, if you are storing actual object references would be to have a sort method that iterated through the collection, stored the object reference, search name, and TabOrder (read from the object reference) and then sort the array (with ASORT()). Then, you could clear the collection and reload it in the proper order or just return the objects as a sorted array. There are probably other options as well. It really just depends on exactly what you are needing.
Can you provide more details?
HTH,
Chad
>Hi everybody,
>
>I'm not sure, how can I add items to the collection based on their TabOrder in the form.
>
>Here is my current code, I'd like to modify it to put controls in the TabOrder sequence. How should I do it?
>
>
>*---------------------- Location Section ------------------------
>* Library: Aformssearch.vcx
>* Class: Frmquicksearch
>* Method: Registercontrols()
>*----------------------- Usage Section --------------------------
>*) Description:
>*)
>
>* Scope: Public
>* Parameters:
>*$ Usage:
>*$
>* Returns:
>*--------------------- Maintenance Section ----------------------
>* Change Log:
>* CREATED 05/20/2005 - NN
>* MODIFIED
>*----------------------------------------------------------------
>lparameters tcClassName, tcNamedSearch
>
>with thisform.oSearchCollection
> if .getkey(m.tcNamedSearch) = 0
> .add(m.tcClassName, m.tcNamedSearch)
> endif
>endwith
>
>
>
>My container object has a name of "o" + m.tcNamedSearch and it's placed directly on the form.
>
>Thanks in advance.
_________________________________
There are 2 types of people in the world: