Why does this first code sort the picklist and the second doesn't. (The first is on a form called Fitness; the second is on the Profile form)
Correct One: From a command button on a form called "Fitness"; this displays the 3 elements in sorted by last name in a picklist
var MyStr as String
var VLName as String
var vinfo as string
Throwfocus(Last Name)
MyStr = @XLookupSourceListall(@fn, "..", "Profile!Last Name", "Last Name;First Name;Key Number5")
MyStr = @replace(MyStr, ";", " " + @chr(149) + " ")
MyStr = @replace(MyStr, @Chr(10), ";")
//WriteLN(MyStr)
vLName = @PopupMenu(MyStr,"Select one of these Employees")
//WriteLn(vLName)
myStr = @Replace(VLName, " " + @chr(149) + " ", ";")
//If @XLookupSourceList was successful then put values in elements
Last Name = @AccessStringArray(myStr, 1)
First Name = @AccessStringArray(myStr, 2)
Key Number5 = @AccessStringArray(myStr, 3)
Incorrect one: From a command button on the form "Profile"; this displays the 3 elements in NOT sorted by last name in a picklist
var MyStr as String
var VLName as String
var vinfo as string
var vsearch as string
MyStr = @XLookupSourceListall(@fn, "..", "Last Name", "Last Name;First Name;Gender1;Date of Birth0;Key Number5")
MyStr = @replace(MyStr, ";", " " + @chr(149) + " ")
MyStr = @replace(MyStr, @Chr(10), ";")
//WriteLN(MyStr)
vLName = @PopupMenu(MyStr,"Select one of these Employees")
//WriteLn(vLName)
myStr = @Replace(VLName, " " + @chr(149) + " ", ";")
//If @XLookupSourceList was successful then put values in elements
Last Name = @AccessStringArray(myStr, 1)
First Name = @AccessStringArray(myStr, 2)
vsearch = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")
Age=@int(@abs((@date-Date of Birth0)/365))