Yes, that is exactly what I meant sorry I was not more clear. I will try
it and let you know if it works. I appreciate the help.
> You mean you want to move the selected item to the top of the list?
>
> If so, add the item-string to the beginning of the output string instead
of
> at the end, like this:
>
> Dim sOutput
> do while not .EOF
> if selectedItem then
> sOutput = "<option selected bla bla bla>" & sOutput
> else
> sOutput = sOutput & "<option bla bla bla>"
> end if
> .....
> Loop
>
> This will "move" all the selected items to the top of the list, followed
by
> the rest.
> Add a control flag that keeps track whether an item has already been
moved
> to the top if you only want to move the first item to the top
>
> Hope this helps,
>
> Imar
>
>
>
> At 05:56 PM 7/26/2001 +0000, you wrote:
> >In a drop down that I am displaying as a MULTIPLE size="5" within an ASP
> >page I am wanting to display the first "SELECTED" option at the top of
> >this dropdown box. Is there a way to do this? Any help would be
> >appreciated. Here is the code that I am using:
> >
> >
> >strSQLSociety = "SELECT DISTINCT EnterprsPhysnId, Lookuptblcode,
> >TableArgmnt, TableResult, COUNT(enterprsphysnid) AS Selected " & _
> >
> >"FROM OPENQUERY(LOOKUPTABLES,'SELECT * FROM GetLookUpTableValues_Fun
> >(''PhysnSocy'',''a'')') " & _
> >
> >"LEFT OUTER JOIN THRPhysnGrpMbrshp_View " & _
> >
> >"ON TableArgmnt = Lookuptblcode " & _
> >
> >"AND EnterprsPhysnId = '" & strenterprsphysnid & "' " & _
> >
> >"GROUP BY enterprsphysnid, Lookuptblcode, tableargmnt, tableresult " & _
> >
> >"ORDER BY TableResult "
> >
> >
> >Set physnsociety_rs = ODSDev_CGuser.Execute(strSQLSociety)
> >strPhysnsocietydescrComboBox = "<SELECT NAME='tableresult' MULTIPLE
> >size='5'>"
> >
> >Do While Not physnsociety_rs.EOF
> >strPhysnsocietydescrComboBox = strPhysnsocietydescrComboBox & "<OPTION
> >VALUE='" & trim(physnsociety_rs("enterprsphysnid")) & "' "
> >If physnsociety_rs("Selected") Then strPhysnsocietydescrComboBox
> >strPhysnsocietydescrComboBox & "SELECTED"
> >strPhysnsocietydescrComboBox = strPhysnsocietydescrComboBox & ">" &
> >physnsociety_rs("tableresult") & " </OPTION>" & vbCRLF
> >iCounter = iCounter + 1
> >physnsociety_rs.MoveNext
> >'Response.Write "*" & physnsociety_rs("tableresult") & "*<br>"
> >Loop
> >strPhysnsocietydescrComboBox = strPhysnsocietydescrComboBox
& "</SELECT>"
> >intCounter = iCounter - 1
>