Hi All,
I have a combobox control on a form that I use to control filter conditions by listing the contents of a code table. But before I add those into the combo's source control array, I add a few other options at the start (Like reset all, and two other options based on the setting of a toggle).
The problem is, I have the code table as part of the data environment, with an order set on (so they appear in alpha order). But the requery() of the control seems to take place before that is set up.
So I tried to force the order with the following code:
Yet much to my surprise, it still doesn't respect the order of the CTSTATUS table. The entries in the array are listed in the order of the native table without an index set on.
I'm baffled... any idea how I can get this in the order I am expecting (based on the index)?
Very oddly, another control on the same form which is used as the listbox options for setting the value at the client level works fine:
SELECT DISTINCT COMPANYACCOUNTMANAGER FROM COMPANY INTO ARRAY This.SourceArray
That control has the entries in the order of the Index.
Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS
"Everything should be made as simple as possible, and no simpler."
I have a combobox control on a form that I use to control filter conditions by listing the contents of a code table. But before I add those into the combo's source control array, I add a few other options at the start (Like reset all, and two other options based on the setting of a toggle).
The problem is, I have the code table as part of the data environment, with an order set on (so they appear in alpha order). But the requery() of the control seems to take place before that is set up.
So I tried to force the order with the following code:
Code:
DIMENSION This.SourceArray(RECCOUNT('CTSTATUS'),1)
*
This.SourceArray (1,1) = "Show All"
This.SourceArray (2,1) = "DC Related"
This.SourceArray (3,1) = "Non-DC Related"
*
SELECT CTSTATUS
SET ORDER TO COMPSTATUS && UPPER(COMPANYSTATUS)
GO TOP
DO WHILE NOT EOF()
This.SourceArray(RECNO(),1) = CTSTATUS.COMPANYSTATUS
SELECT CTSTATUS
SKIP
ENDDO
Yet much to my surprise, it still doesn't respect the order of the CTSTATUS table. The entries in the array are listed in the order of the native table without an index set on.
I'm baffled... any idea how I can get this in the order I am expecting (based on the index)?
Very oddly, another control on the same form which is used as the listbox options for setting the value at the client level works fine:
SELECT DISTINCT COMPANYACCOUNTMANAGER FROM COMPANY INTO ARRAY This.SourceArray
That control has the entries in the order of the Index.
Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS
"Everything should be made as simple as possible, and no simpler."