jennypretty
12-02-2008, 07:42 PM
Hello,
Can anyone please help me on multiple selection box?
I have this table:
Cars Date-Sold Sellers
--- --------- -------
A 02/09/2008 aa
B 3/08/2008 bb
C 8/02/2008 aa
B 9/04/2008 cc
A 11/02/2008 bb
A 10/04/2008 cc
I tried to create a INSERT page that uses the data from an existing table for selection boxes:
1. When a user select "Cars type"
2. Date sold and shipped will show up based on "cars type" selected
3. When Date sold/shipped was selected, Seller's names will show up based on "date sold/shiped" selected
I keep getting this error below. I already turned on the friendly errors url.
Can you please help?
Thanks you so much!
Technical Information (for support personnel)
Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/tran/selectcombo2.asp, line 63
Page:
POST 43 bytes to /tran/selectcombo2.asp
POST Data:
cars=1&dateSold=1%2F6%2F2008+-+2%2F9%2F2008
Time:
Monday, December 01, 2008, 10:18:57 AM
-----------------------------------------------------
<b>Select a car type to view dates sold</b>
<br><bR>
<form name="frmSelect" method="Post" action="selectcombo2.asp">
<fieldset>
Select Car Type :
<% Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT DISTINCT Cars FROM tblComboSelect ORDER BY Cars;"
oRs.Open strSQL, conn
if not oRs.eof then %>
<SELECT name="cars" onChange="Javascript:frmSelect.submit();">
<OPTION VALUE = "1" >
<% do until oRs.EOF %>
<OPTION VALUE="<%= oRS(0) %>" <% if trim(request.form("Cars")) = trim(oRS(0)) then response.write " selected " end if %>><%= oRS(0) %></option>
<% oRs.MoveNext
loop %>
</SELECT>
<% else %>
<i>No cars found in the database</i>
<% end if %>
<br />
Date(s) Shipped and Sold :
<% if trim(request.form("Cars")) <> "" then
'user has selected a car therefore show dates select box
strSQL = "SELECT DateShippedIn, DateSold FROM tblComboSelect WHERE Cars='" & trim(request.form("Cars")) & "';"
Set oRs=Server.CreateObject("adodb.recordset")
oRs.Open strSQL, conn
if not oRs.eof then %>
<select name="dateSold">
<% do until oRs.eof %>
<option value="<%= ors("DateShippedIn") %> - <%= ors("DateSold") %>"><%= ors("DateShippedIn") %> - <%= ors("DateSold") %></option>
<% oRs.MoveNext
loop %>
</select>
<% else %>
<i>No records found for that car</i>
<% end if
else
'user has not selected a car therefore do not show date select box
response.write "<i>No car selected yet</i>"
end if %>
</fieldset>
<br />
Sellers :
<% if trim(request.form("dateSold")) <> "" then
strSQL = "SELECT sellerLast, sellerFirst FROM tblComboSelect WHERE DateSold='" & trim(request.form("DateSold")) & "' AND DateShippedIn='" & trim(request.form("DateShippedIn")) & "';"
Set oRs=Server.CreateObject("adodb.recordset")
oRs.Open strSQL, conn
if not oRs.eof then %>
<select name="dateSold">
<% do until oRs.eof %>
<option value="<%= ors("sellerLast") %>, <%= ors("sellerFirst") %>"><%= ors("sellerLast") %>, <%= ors("sellerFirst") %></option>
<% oRs.MoveNext
loop %>
</select>
<% else %>
<i>No records found for that car</i>
<% end if
else
'user has not selected a car therefore do not show date select box
response.write "<i>No car selected yet</i>"
end if %>
</fieldset>
</form>
Thanks.
Can anyone please help me on multiple selection box?
I have this table:
Cars Date-Sold Sellers
--- --------- -------
A 02/09/2008 aa
B 3/08/2008 bb
C 8/02/2008 aa
B 9/04/2008 cc
A 11/02/2008 bb
A 10/04/2008 cc
I tried to create a INSERT page that uses the data from an existing table for selection boxes:
1. When a user select "Cars type"
2. Date sold and shipped will show up based on "cars type" selected
3. When Date sold/shipped was selected, Seller's names will show up based on "date sold/shiped" selected
I keep getting this error below. I already turned on the friendly errors url.
Can you please help?
Thanks you so much!
Technical Information (for support personnel)
Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/tran/selectcombo2.asp, line 63
Page:
POST 43 bytes to /tran/selectcombo2.asp
POST Data:
cars=1&dateSold=1%2F6%2F2008+-+2%2F9%2F2008
Time:
Monday, December 01, 2008, 10:18:57 AM
-----------------------------------------------------
<b>Select a car type to view dates sold</b>
<br><bR>
<form name="frmSelect" method="Post" action="selectcombo2.asp">
<fieldset>
Select Car Type :
<% Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT DISTINCT Cars FROM tblComboSelect ORDER BY Cars;"
oRs.Open strSQL, conn
if not oRs.eof then %>
<SELECT name="cars" onChange="Javascript:frmSelect.submit();">
<OPTION VALUE = "1" >
<% do until oRs.EOF %>
<OPTION VALUE="<%= oRS(0) %>" <% if trim(request.form("Cars")) = trim(oRS(0)) then response.write " selected " end if %>><%= oRS(0) %></option>
<% oRs.MoveNext
loop %>
</SELECT>
<% else %>
<i>No cars found in the database</i>
<% end if %>
<br />
Date(s) Shipped and Sold :
<% if trim(request.form("Cars")) <> "" then
'user has selected a car therefore show dates select box
strSQL = "SELECT DateShippedIn, DateSold FROM tblComboSelect WHERE Cars='" & trim(request.form("Cars")) & "';"
Set oRs=Server.CreateObject("adodb.recordset")
oRs.Open strSQL, conn
if not oRs.eof then %>
<select name="dateSold">
<% do until oRs.eof %>
<option value="<%= ors("DateShippedIn") %> - <%= ors("DateSold") %>"><%= ors("DateShippedIn") %> - <%= ors("DateSold") %></option>
<% oRs.MoveNext
loop %>
</select>
<% else %>
<i>No records found for that car</i>
<% end if
else
'user has not selected a car therefore do not show date select box
response.write "<i>No car selected yet</i>"
end if %>
</fieldset>
<br />
Sellers :
<% if trim(request.form("dateSold")) <> "" then
strSQL = "SELECT sellerLast, sellerFirst FROM tblComboSelect WHERE DateSold='" & trim(request.form("DateSold")) & "' AND DateShippedIn='" & trim(request.form("DateShippedIn")) & "';"
Set oRs=Server.CreateObject("adodb.recordset")
oRs.Open strSQL, conn
if not oRs.eof then %>
<select name="dateSold">
<% do until oRs.eof %>
<option value="<%= ors("sellerLast") %>, <%= ors("sellerFirst") %>"><%= ors("sellerLast") %>, <%= ors("sellerFirst") %></option>
<% oRs.MoveNext
loop %>
</select>
<% else %>
<i>No records found for that car</i>
<% end if
else
'user has not selected a car therefore do not show date select box
response.write "<i>No car selected yet</i>"
end if %>
</fieldset>
</form>
Thanks.