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!

Dropdown Box and Selected Value upon page refresh

Status
Not open for further replies.

bobbybrown69

Programmer
Jun 11, 2003
15
US
Any idea why I can get the Response.Write to display the number 2147 but when I uncomment this code:

'If 2491 = rsTemp2("EmployeeID") Then

and use this code:

If lHelpDeskEmployees = rsTemp2("EmployeeID") Then

I can't get the proper value to be selected in the dropdown box. I am using the 2491 to test it but the value could be different if the user chooses another option. The variable lHelpDeskEmployees value is 2491 when I do a Response.Write and the value 2491 is a value in the dropdown box and in the Querystring. I have also tried Request("Employees") as well as Request.Form("Employees")

I have been playing with this for hours. Any ideas what I am doing wrong?

Thanks.
------------------------------------------------------
<select name=&quot;Employees&quot; id=&quot;Employees&quot; size=&quot;1&quot;>
<option value=&quot;0&quot; selected> </option>
<%
Dim rsTemp2, lHelpDeskEmployees

lHelpDeskEmployees = Request.QueryString(&quot;Employees&quot;)

Set rsTemp2 = dbCoastal.Execute(&quot;SelectHelpDeskEmployees&quot;, , 4)
Do While Not rsTemp2.EOF
If lHelpDeskEmployees = rsTemp2(&quot;EmployeeID&quot;) Then Response.Write(&quot;<option SELECTED value=&quot; & rsTemp2(&quot;EmployeeID&quot;) & &quot;>&quot; & rsTemp2(&quot;NickName&quot;) & &quot; &quot; & rsTemp2(&quot;LastName&quot;) & &quot;</option>&quot; & vbCrLf)
Else
Response.Write(&quot;<option value=&quot; & rsTemp2(&quot;EmployeeID&quot;) & &quot;>&quot; & rsTemp2(&quot;NickName&quot;) & &quot; &quot; & rsTemp2(&quot;LastName&quot;) & &quot;</option>&quot; & vbCrLf)
End If
'If 2491 = rsTemp2(&quot;EmployeeID&quot;) Then
'Response.Write(&quot;<option SELECTED value=&quot; & rsTemp2(&quot;EmployeeID&quot;) & &quot;>&quot; & rsTemp2(&quot;NickName&quot;) & &quot; &quot; & rsTemp2(&quot;LastName&quot;) & &quot;</option>&quot; & vbCrLf)
'End If

rsTemp2.MoveNext
Loop
rsTemp2.Close
Set rsTemp2 = Nothing
%>
</select>


<% Response.Write(lHelpDeskEmployees) %>
 
Try to use Clng(rsTemp2(&quot;EmployeeID&quot;))

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top