Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2002
    Location
    NW Iowa
    Posts
    185
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Making option box select from lookup table

    I'm not of the logic behind this, or even the correct wording to describe it to you, but here goes:

    I have a "Modify Record" page. The page is passed a URL parameter which is the record ID. Part of the record is a 'Category'. In the database, this field is a lookup table. How can I get a drop-down menu on the "Modify Record" page to recognize the lookup table? Playing with Dreamweaver, I've gotten it to show "3", which is the correct ID of the category. But what I'd like is to have a drop-down menu of the category names, with the correct one being displayed.

    In my database I do have two different tables, one for the records, and one for the category names. I also have 2 recordsets, one for each table.

    Here is the Dreamweaver-created code for my option box:
    Code:
    <select name="select">
    <%
    While (NOT rs_AdminProjCat.EOF)
    %>
       <option value="<%=(rs_AdminProjCat.Fields.Item("Category").Value)%>">
          <%=(rs_AdminProjCat.Fields.Item("Category").Value)%>
       </option>
    <%
       rs_AdminProjCat.MoveNext()
          Wend
             If (rs_AdminProjCat.CursorType > 0) Then
               rs_AdminProjCat.MoveFirst
             Else
               rs_AdminProjCat.Requery
             End If
    %>
                    </select>
    The current code shows all the category names, but does not select the one that is associated with the record (note, the correct category is selected for all records when viewing the database).

  • #2
    Regular Coder
    Join Date
    Dec 2002
    Location
    NW Iowa
    Posts
    185
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Fixed.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, since you fixed it yourself before anyone was able to help, I'll go ahead and close the thread.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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