I want to pass 2 variables using a dropdown

D

Dave

In the dropdown code below, I can pass the variable rs("CC").

I want to also pass the variable rs("DistDB") but I have not been able
to do so without error.

The code below will pass the hidden value DistDB but not DistDB
without a type mismatch code.

Is there a way to pass 2 varaibles with a single selection in a
dropdown or do you see a type mismatch error with the DistDB2 value.

These are text fields populating an Access DB.



<select name="CC" size="1">
<option selected>Select a location</option>
<% While NOT rs.EOF %>
<option value="<%=rs("CC")%>"><%=rs("CC")%> -
<%=rs("DistDB")%></option>
<%
rs.MoveNext
Wend
SET rs= nothing
%>
</select><p>
<input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" name="B2"></p>
<input type="hidden" name="DistDB" value="St Louis">
<input type="hidden" name="DistDB2" value="<%=rs("DistDB")%>">
 
T

Thomas A. Rowe

One option is to pass the single value from the dropdown, then on the next page do another query to
the database to retrieve the missing value.

If your values in the drop down where/are fix number of characters, then you could combine them, and
then on the next page split them apart.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
D

Dave

Thanks.

Is it safe to assume that a Hidden field cannot be used with a
dropdown?

Dave
 
T

Thomas A. Rowe

No, as a hidden form field can be used with any form submission.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top