Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is record in combobox not alphabetically arranged? 2

Status
Not open for further replies.

Mandy_crw

Programmer
Jul 23, 2020
578
PH
Hi everyone... i have these code in Load procedure....

SELECT PADR(ALLTRIM(UPPER(sname)) + ", " + ALLTRIM(fname),25), idnum FROM tsulat ORDER BY sname, fname INTO CURSOR PgBseCbo

my question is, why is it not showing alpabetically in the dropdown list, not all but some of the record are not in proper order? did i miss something? Thanks and God bless...
 
Hi Mandy,

The combo/listbox has no load event. Please reread the code I provided in thread thread184-1824310

hth

MarK
 
Sorting by collation sequence MACHINE is the usuual sorting, unless you defined special collations for fields. It sorts English okay, may only fail on some special characters with diacritics or umlauts, for example. Most likely, you also get Names starting with lowercase letters after names starting with uppercase letters, as 'a' has a byte value of 97 while 'Z' has 90. So all lowercase letter are sorted after all uppercase letters, too, even when you only use the English/Latin 26 letters without any accents, etc.

Chriss
 
Just to follow up Chris's reply, you might need to issue a SET COLLATE command immediately before the SELECT. For example, if you have Spanish names in the table, and the names might include characters such as Ñ or any accented letter, then you should do [tt]SET COLLATE TO "SPANISH"[/tt].

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thank you Mike, Chris, Mj for always helping.. God bless....

Ok I'll Try putting collate... Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top