Jack wrote:
> Well Bob, I just trimmed my code to get a test asp page.

Obviously, you and i have different ideas about what constitutes a "small"
test page
> Here please
> note that the tblYear has YearId and Year field. I need to display
> the Year Value, yet capture the YearId(ie. the selected one from the
> list box) in the processing form using request object. This YearId
> will go the sql statement in the processing form.This is the main
> issue to me ie. how to display one field in the list box yet capture
> the corresponding ID from the form in the processing asp page using
> request form object. Hope I could explain well. Here is the code for
> the test page. Thanks. Regards,
>
This is why I told you to set the value attribut to the YearID instead of
the Year. here, try this to see:
<!-- #include file="connection.asp" -->
<!-- #include file="adovbs.inc" -->
<%
strSQL3 = "SELECT YearId, Year FROM tblYear"
Set RS_Year =conn.execute(strsql3,,1)
if not rs_year.eof then arData=rs_year.getrows
rs_year.close:set rs_year=nothing
conn.close: set conn=nothing
sHTML=""
if isarray(ardata) then
for i = 0 to ubound(ardata,2)
shtml = shtml & "<option value = """ & _
ardata(0,i) & """>" & ardata(1,i) & "</option>"
next
end if
if len(request.form("lstYear")) > 0 then
response.write "The value of the option you selected is """ & _
request.form("lstYear")
end if
%>
<html><body><form method=POST >
<SELECT NAME= "lstYear" SIZE="1">
<%=shtml%>
</SELECT>
<input type="submit" value="Submit" >
</form></body></html>
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.