drop-down accessing previous data

Results 1 to 3 of 3

Thread: drop-down accessing previous data

  1. #1
    sktnggtr Guest

    Default drop-down accessing previous data

    I am having a problem and have tried this for some time now. a.asp is a page where you type in the number you wish to view. This takes you to b.asp. b.asp is a table where all fields are fill-in except for the last field. The last field is a drop-down box that is populated from an Access database table. Sometimes there is already data in this field. I want the user to have the option to change it with the drop-down or keep it the same if they wish. Right now, the drop-down works, but it does not pull any previous data from the database. How can I do this?

  2. #2
    Join Date
    Dec 1969

    Default RE: drop-down accessing previous data

    Just put &#060;OPTION SELECTED Value=....&#062; instead of &#060;OPTION Value=...&#062; for the one option that you want pre-selected.<BR><BR>How do you know which to do that to? By comparing the value of the field from the recordset for that user with each of the values you will put into the list of options.<BR><BR>&#060;OPTION &#060;% If RS("val") = "Apple" Then Response.Write "SELECTED" %&#062; VALUE="Apple"&#062; Macintosh<BR>&#060;OPTION &#060;% If RS("val") = "Dell" Then Response.Write "SELECTED" %&#062; VALUE="Dell"&#062; Ding Dong<BR>...<BR><BR>There are other more clever ways, but leave them for later, when you get more experience. <BR><BR><BR>

  3. #3
    sktnggtr Guest

    Default RE: drop-down accessing previous data

    &nbsp;<BR>I did that already but this is now accessing the last record alphabetically from the Access table, instead of accessing the actual data from that field. What did I forget?

Posting Permissions

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