Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access form data on action page, within Query 1

Status
Not open for further replies.

markbanker

Programmer
Mar 6, 2001
37
US
I need to use the value of a user's selection within the WHERE clause of my SQL statement on the page that the form was submitted to. I keep getting errors, saying that it doesn't recognize my variable. What am I doing wrong? It should be so simple. The form is dynamically populated using the get_prodCat Query. Here's the code snippets from the two pages:

Code:
<FORM METHOD=&quot;post&quot; ACTION=&quot;search_display.cfm&quot;>
  <SELECT>
    <OPTION VALUE=0>-Category-
    <CFOUTPUT QUERY=&quot;get_prodCat&quot;>
    <OPTION NAME=&quot;ca_id&quot; VALUE=&quot;#ca_id#&quot;> #ca_desc#
    </CFOUTPUT>      
  </SELECT>
  <INPUT TYPE=&quot;submit&quot; VALUE=&quot;Search&quot;>
</FORM>

file: search_display.cfm

<CFQUERY NAME=&quot;get_prodCat&quot; DATASOURCE=&quot;EMSCO&quot; DBTYPE=&quot;ODBC&quot;>
        SELECT ca_id, 
        ca_desc
        FROM category
        WHERE ca_id = #ca_id#
</CFQUERY>
Thanks for your help!

Mark Banker
 
You are not specifying NAME in your <SELECT> tag. Once you specify a name for your select box, like NAME=&quot;ca_id&quot;, you should be trouble free! Andrew
 
Andrew,

Thank you very much! I had been fighting this little issue for several hours, and just never saw that. It's like trying to proofread your own writing I guess.

Mark Banker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top