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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pulldown lists and auto complete

Status
Not open for further replies.

HardHat

IS-IT--Management
Aug 7, 2003
14
US
Hi All,

I have a series of code within an ASP page that looks up the contents of a field in an acess table to create a pull down selection list. What I want to do, is use the select record to auto fill in a series of other input fields (data is supplied in different fields of the same table).

I'm at a complete loss on the best way to complete this ... The code I have for the pull-down selection list is as follows :

<select name="book" id="formatsupp0" size="1">
<%

Dim strSQLbook, RSbook, currentbook

Dim strRecordsbook

Set RSbook = Server.CreateObject("ADODB.Recordset")

strSQLbook = "Select book from books order by unique"
RSbook.Open strSQLbook, DB


If Not RSbook.EOF Then
strRecordsbook = "<OPTION VALUE='0'>"
Do While Not RSbook.EOF
strRecordsbook = strRecordsbook _
& "<OPTION VALUE='" & RSbook("book") & "'>" & RSbook("book") & vbCrLf

RSbook.MoveNext
Loop
Else
strRecordsbook = "<OPTION VALUE='0'>No records found"
End if

Response.Write strRecordsbook
strRecordsbook = ""
RSbook.Close
%>
 
You must autosubmit the form after the user has selected an item then open a another recordset where you select all records matching the choice from the select box.
You finally populate textboxes or other form items like this

<input type="text" name="somename" value="<%=RS("field")%>">

Post back if not clear or in need of more detailed help

Bye

Qatqat

Life is what happens when you are making other plans.
 
Hi, not quite sure what I should be doing here ... thanks for any more advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top