[thelist] ASP Select Form not auto-selecting

Ken Schaefer ken at adOpenStatic.com
Fri Sep 26 20:33:00 CDT 2003

Couple of things:

a) Remember that CInt() will overflow at approximately 32,000. You need to
use CLng() for larger numbers (up to approximately 2,000,000,000)

b) If you are getting type mismatch errors, then you can't do the specific
cast for some reason, for example you do not have value able to be cast as
an integer.

c) I really recommend that you ditch the inline spaghetti code. You post
"just when you thought you
were fluent in a language, you learn something new". No one writes that type
of messy code anymore.

    <td>Select a Manager:</td>
    <td><%=WriteFormSelectList("cboManagers", arrManagers, 1,

is much neater.


----- Original Message ----- 
From: "Rob Smith" <rob.smith at THERMON.com>
To: <thelist at lists.evolt.org>
Sent: Friday, September 26, 2003 11:19 PM
Subject: RE: [thelist] ASP Select Form not auto-selecting

: >Low and behold my output is:
: >92503 92503
: >
: >Yet... the test to compare these two to enable the "selected" feature,
: >fails.
: I'd like to come back and all your suggestions worked like a charm, but I
: can't...
: This is what I started out with:
: Var1 = request.form("Manager")
: Var2 = Managers.fields.item("RepID").value
: If Var1 = Var2 then
: Response.Write(" selected ")
: Else
: ' values are not equal
: End If
: Casting request.form("Manager") as anything gave me a type mismatch error
: CInt(request.form("Manager"))  --->  Type mismatch
: Trim   (both) "" --->  Test still failed; no err
: CLng "" "" --->  Type mismatch
: CStr (both) "" --->  Test still failed; no err
: This is really annoying me. The data type that the record set came from is
: Int(4). Any other suggestions?

More information about the thelist mailing list