473,513 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List Box Issue, Selected results not showing when updating

Stang02GT
1,208 Recognized Expert Top Contributor
I have a couple list boxes on a form that query a database table for certain values to display in the box. My problem is that the users are able to select multiple options in these list boxes and then save the form to the database. When they come back into the form to make updates the list boxes are only highlighting the one of the options in the list box and i need it to highlight all of the options the user selected.

Here is the code for one of these boxes.


Expand|Select|Wrap|Line Numbers
  1. <td>Analysis Type</td>
  2. <td><select name=ANALYSIS_TYPE size=4 multiple style="width:280px;height:380px;">
  3.          <%
  4.         sql = "SELECT APP_LIST_VALUE_DESC from  TICKER_APP_LIST_VALUE WHERE APP_LIST_ID = 4 ORDER BY APP_LIST_VALUE ASC  "      
  5.         set rs = server.CreateObject("adodb.recordset")
  6.         rs.Open sql, conn
  7.         while not rs.eof 
  8.         Response.Write("<option value='"&rs(0)&"'")
  9.         if cstr(ANALYSIS_TYPE_UP)=cstr(rs(0)) then
  10.          Response.Write (" selected ")
  11.         end if
  12.         Response.Write(">"&rs(0))
  13.         rs.movenext
  14.         wend
  15.         rs.close
  16.         set rs = nothing%>
  17.     </select>
Jul 29 '10 #1
1 1331
jhardman
3,406 Recognized Expert Specialist
When you look at the code, do all of the selected options have the term "selected" added?

Jared
Aug 6 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
10801
by: Kris Rockwell | last post by:
Hello (again), I have gotten the dropdown list functionality to work through a few tricks (probably not the most efficient, but it works) but I am not sure how to set the default selected value....
0
1541
by: jw56578 | last post by:
I have a dropdownlist in a panel on the page. autopostback is set to true. when i choose the second option in the the list, the selected index event is triggered fine. when i go back and choose the...
10
5629
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
14
2104
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
2
8899
by: Jason Huang | last post by:
Hi, I am wondering why use the DataTableMapping in SqlDataAdapter when Updating data. Would someone give me some advice? Thanks for help. Jason
1
1449
by: rgdwar1 | last post by:
Hello, I have two issues I need help with: I have a Data Entry form called Frm_Entry (with a corresponding table) with the following fields: Date Assigned (Date) Date Processed (Date) Date...
0
1564
by: JenniferG | last post by:
I've worked with ASP.NET but don't know much about ASP at all. I have the following code. I would like to get a person' birthday and phone number text box populated when the person's name is selected...
3
2725
by: Reg Verrin | last post by:
I have a program that displays constantly changing prices which it sources from the web once per second. The prices are displayed on a Listbox (not the best choice but there are good reasons for...
11
3011
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit (using .net version 3.5) is closed before the Ajax enable controls complete loading, then IE locks up. Does it in both IE7...
4
1750
by: DragonLord | last post by:
I have a strange situation, I am looping through a datagrid view and updating the database with the results from each row that is timestamped when it is selected. foreach (DataGridViewRow...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7539
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.