Passing a name in a form select option

Results 1 to 2 of 2

Thread: Passing a name in a form select option

  1. #1
    Audrey Rowe Guest

    Default Passing a name in a form select option

    I have an sql in which i am selecting a category_id along with other fields from two tables which are joined by a Report_ID. The sql works perfectly however, in my form i have a drop down box <select> <option> which gets the category_id which matches the report_id. This also is working correctly. However, i need the drop down box to list the category_name which is in another table called tblCategory which i did not join in my sql. How do i get the category_name to display in the list box instead of the category_id? I tried selecting the category_name from table3 but am getting an error in my sql. Is there another way? A promptly reply would be appreciated.

  2. #2
    Sam Otto Guest

    Default RE: Passing a name in a form select option

    You have to "join in" tblCategory in the SQL and select category_name. Another, mush more inefficient, way is to do a query: SELECT category_name FROM tblCategory WHERE category_id=id where id is the value from the first query. The best option would be to get this "static" list early ( when the application starts in global.asa) store it, and use the list every time you create your select list...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •