Unanswered: Setting drop-down initial value in an update form
I am trying to create a form that will update a record in an access database. I have successfully created the ASP pages to add the records to the database and I am working on a page to update records in the database. (Using the DRW in Frontpage)
I am using one database with two tables (virtual library). The 'Books' table contains the fields for the ID, title, publisher etc and the 'Categories' table contains a list of categories that the book may belong in and the table ID.
I have successfully added the 'categories' drop down, but the problem is that I need it to have the same initial value that the current database record has.
For instance, the field in the database called Categories was populate with 'Training' when the record was entered. When I bring up the form to edit this record I would like the drop down to be populated with 'Training' for this record. I currently have an option that shows me the first value in the table which is 'Acts'.
How do I get the form to conditionally set the initial value of the drop down list?
<%if Utility = "E" then %>
<option SELECTED value="E"> Electric </option>
<option value="E"> Electric </option>
<%end if %>
<%if Utility = "G" then %>
<option SELECTED value="G"> Gas </option>
<option value="G"> Gas </option>
<%end if %>