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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a listbox on a data entry page

Status
Not open for further replies.

david7777777777

Programmer
Sep 26, 2001
417
US
How do you have a listbox, which is displaying items from table A, be used as part of a data entry page that is used to enter new records into table B?

Thanks.
 
<SELECT name=&quot;Item&quot;>
<% Do while not rs.EOF
Response.write &quot;<OPTION value=&quot; & Rs(Field1) & &quot;>&quot; & Rs(Field2) & &quot;</OPTION>
rs.movenext
loop %>
</select>

 
A list has a visible part, and an invisible 'value' part. Make the 'value' the code used to link the two tables.

This is very easy if you use the DTCs (design-time controls).

A list can be single select (the default) - similar to a combo. Or multi-select.

In either case, when the form is submitted, the Request buffer will include the list name followed by the selected value (or comma separated list of values).

So you could use this in an SQL update...
&quot;Update xTable Set aLinkCol = &quot; & Request.Form(&quot;alist&quot;) _
& &quot; Where .....

I hope you get the picture! (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top