foundsheep
Programmer
I have a drop down list that is being populated by a database, and it is throwing an 800a000d Type Mismatch error. Here is the line of code the error occurs on:
<option value="<%=rsCus("cusID")%>" <%if CInt(rsCus("cusID")) = CInt(d) then%> selected<%end if%>><%=rsCus("Company")%></option>
Here's the entire form:
<form name="frmDisp" action="dispatch.asp?action=addDisp2" method="post">
<table cellSpacing="0" cellPadding="3" width="800" border="0" class="main_table">
<tr>
<td BGCOLOR="silver" class="table_Header" colspan="2">ADD DISPATCH</td>
</tr>
<tr>
<td width="15%">Company:</td>
<td>
<select id="company" name="company" onChange="this.form.submit()">
<option>Choose . . .</option>
<%
call openConn()
Dim d
d = Request("company")
Set rsCus = Server.CreateObject("ADODB.Recordset")
rsCus.Open "SELECT * FROM Customer", db, 3, 3, 1
Do Until rsCus.EOF
Dim c
c = rsCus("cusID")
%>
<option value="<%=rsCus("cusID")%>" <%if CInt(rsCus("cusID")) = CInt(d) then%> selected<%end if%>><%=rsCus("Company")%></option>
<%
rsCus.MoveNext
Loop
%>
</select>
</td>
</tr>
<tr>
<td width="15%">Equipment:</td>
<td>
<%
Set rsCon = Server.CreateObject("ADODB.Recordset")
rsCon.Open "SELECT * FROM Serviced_Equipment WHERE cusID = " & Request("company"), db, 3, 3, 1
%>
<%
if not rsCon.EOF then
%>
<select id="equipment" name="equipment" onChange="updateField()">
<option>Choose . . .</option>
<%
Do Until rsCon.EOF
%>
<option value="<%=rsCon("conID")%>"><%=rsCon("Description")%></option>
<%
rsCon.MoveNext
Loop
%>
</select>
<%
else
%>
Choose Company With Equipment
<%
end if
call closeConn()
%>
</select>
</td>
</tr>
</form>
<option value="<%=rsCus("cusID")%>" <%if CInt(rsCus("cusID")) = CInt(d) then%> selected<%end if%>><%=rsCus("Company")%></option>
Here's the entire form:
<form name="frmDisp" action="dispatch.asp?action=addDisp2" method="post">
<table cellSpacing="0" cellPadding="3" width="800" border="0" class="main_table">
<tr>
<td BGCOLOR="silver" class="table_Header" colspan="2">ADD DISPATCH</td>
</tr>
<tr>
<td width="15%">Company:</td>
<td>
<select id="company" name="company" onChange="this.form.submit()">
<option>Choose . . .</option>
<%
call openConn()
Dim d
d = Request("company")
Set rsCus = Server.CreateObject("ADODB.Recordset")
rsCus.Open "SELECT * FROM Customer", db, 3, 3, 1
Do Until rsCus.EOF
Dim c
c = rsCus("cusID")
%>
<option value="<%=rsCus("cusID")%>" <%if CInt(rsCus("cusID")) = CInt(d) then%> selected<%end if%>><%=rsCus("Company")%></option>
<%
rsCus.MoveNext
Loop
%>
</select>
</td>
</tr>
<tr>
<td width="15%">Equipment:</td>
<td>
<%
Set rsCon = Server.CreateObject("ADODB.Recordset")
rsCon.Open "SELECT * FROM Serviced_Equipment WHERE cusID = " & Request("company"), db, 3, 3, 1
%>
<%
if not rsCon.EOF then
%>
<select id="equipment" name="equipment" onChange="updateField()">
<option>Choose . . .</option>
<%
Do Until rsCon.EOF
%>
<option value="<%=rsCon("conID")%>"><%=rsCon("Description")%></option>
<%
rsCon.MoveNext
Loop
%>
</select>
<%
else
%>
Choose Company With Equipment
<%
end if
call closeConn()
%>
</select>
</td>
</tr>
</form>