Results 1 to 3 of 3

Thread: Auto

  1. #1
    Kevin Guest

    Default Auto

    There propbably a better way..there always is, but I&#039;m trying to select an option in a dropdown box who value is determined by the querystring. Here&#039;s the code:<BR><BR>Response.Write "&#060;SELECT NAME=&#039;region&#039;&#062;"<BR> If Request.QueryString("region") = "" Then<BR> Response.Write "&#060;OPTION VALUE=" & varQuotes & "" & varQuotes & "Selected&#062;Show All" & "&#060;/option&#062;"<BR> Else<BR> Response.Write "&#060;OPTION VALUE=" & varQuotes & "" & varQuotes & "&#062;Show All" & "&#060;/option&#062;"<BR> End If<BR> Do While Not rsDistinctRegions.EOF<BR> If Request.QueryString("region") = rsDistinctRegions("pri_key") Then<BR> Response.Write "&#060;OPTION Selected VALUE=" & varQuotes & rsDistinctRegion("pri_key") & varQuotes & "&#062;" & rsDistinctRegion("state_code") & rsDistinctRegion("region") & "&#060;/option&#062;"<BR> Else<BR> Response.Write "&#060;OPTION VALUE=" & varQuotes & rsDistinctRegion("pri_key") & varQuotes & "&#062;" & rsDistinctRegion("state_code") & rsDistinctRegion("region") & "&#060;/option&#062;"<BR> End If<BR> rsDistinctRegions.MoveNext<BR> Loop<BR> Response.Write "&#060;/SELECT&#062;"<BR><BR><BR>Fill Information:<BR><BR>When I write out the variables (de-bugging), i&#039;m getting valid data, but the dropdown box never resolves. It hangs up with one selection - "Show All". I believe its a data type mismatch in the comparision of the pri_key and the querystring vaiable. I have tried to use various convertions such as CInt, CStr etc..but still no luck...<BR><BR>Help<BR>

  2. #2
    Join Date
    Dec 1969

    Default View | Source in browser?

    Have you done that? What does it show?<BR><BR>What happens if you temporarily comment out your current "IF" test(s) and just do <BR><BR>IF TRUE THEN....<BR>or<BR>IF FALSE THEN....<BR><BR>That will tell you if the problem is in the IF test.<BR><BR>I see a lot of inefficiencies in that code, but nothing that is "wrong", per se. So let&#039;s figure out the bug before we go shrinking the code.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Auto

    I am having the same problem - comparing a querystring ID with and autonumber ID in an access DB. I think it is a type mismatch as well. Here is my code...<BR><BR>surveyID = request.querystring("surveyID")<BR>If not rsSurvey.EOF then<BR> Do while NOT rsSurvey.EOF<BR> response.write(surveyID)<BR> response.write(rsSurvey.Fields("surveyID"))<BR> if surveyID = rsSurvey.Fields("surveyID") then<BR> do something<BR> else<BR> response.write("Not Match")<BR> end if<BR> rsSurvey.MoveNext<BR> Loop<BR> Else<BR> response.write("Survey not found")<BR> End if<BR><BR>Response.write(surveyID) and Response.write(rsSurvey.Fields("surveyID")) print out the exact same thing yet the if statement will not match them and "Not Match" gets printed instead. Please Help...<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts