Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Oct 17, 2017 4:53 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: PopupMenu Ascending Order?
PostPosted: Fri May 17, 2013 12:11 pm 
Offline

Joined: Fri Jun 05, 2009 4:54 pm
Posts: 484
Location: London, England
Hi,
My popupmenu is populated from a database and the code below works perfectly, HOWEVER,
would it be possible to modify the code in order to cause the entries in the popupmenu to be displayed in Ascending order ?


Dim stSQL as String

If db8.Connect = True Then
stSql = "SELECT Sonames FROM SettingsTable"
rs8 = dB8.SQLSelect(stSql)

if rs8 = nil then
msgbox "Problem with Database!"

else
while not rs8.EOF
win_Add.PopupMenu2.AddRow rs8.Field("Sonames").StringValue
rs8.MoveNext
wend
end
end if
rs8.Close


Thank you all in advance.

_________________
RealStudio Professional Edition 2012 r2
Developing on OS X 10.8 (Mountain Lion)
Deploying on Windows XP / Vista / 7 / 8


Top
 Profile  
Reply with quote  
 Post subject: Re: PopupMenu Ascending Order?
PostPosted: Fri May 17, 2013 12:31 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Add an ORDER BY clause to your sql statement to retrieve them in the order you want.

select sonames from SettingsTable order by sonames


Top
 Profile  
Reply with quote  
 Post subject: Re: PopupMenu Ascending Order?
PostPosted: Fri May 17, 2013 12:53 pm 
Offline

Joined: Fri Jun 05, 2009 4:54 pm
Posts: 484
Location: London, England
Duhhhh,
Thanks Tim :)

_________________
RealStudio Professional Edition 2012 r2
Developing on OS X 10.8 (Mountain Lion)
Deploying on Windows XP / Vista / 7 / 8


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group