I do do part of what you’re suggesting…
I have a query for each dropdown (on the advice of ZipperJJ) each query contains a hidden value which is used to pull of all of one record when the item is selected. only when an item is selected are all the fields of one record are queries on the database. this is the instant bit.
the four dropdowns are basically ways of finding a record. four different ways of finding a record depending on what is already known about the record you’re looking for.
here is the code I have at this point (long)
<!-- #include file="includes\db.asp" -->
<%
'***Forename************************************************************************************
Dim arrForename
Set objRS = conn.Execute("SELECT clientid,forename,surname from clients where requeststatusid in (1,2) order by forename")
If not objRS.EOF Then
arrForename = objRS.GetRows()
Else
arrForename = ""
End If
objRS.Close
Set objRS = Nothing
'***Surname************************************************************************************
Dim arrSurname
Set objRS = conn.Execute("SELECT clientid,surname,forename from clients where requeststatusid in (1,2) order by Surname")
If not objRS.EOF Then
arrSurname = objRS.GetRows()
Else
arrSurname = ""
End If
objRS.Close
Set objRS = Nothing
'***Email************************************************************************************
Dim arrEmail
Set objRS = conn.Execute("SELECT clientid,Email,forename,surname from clients where requeststatusid in (1,2) order by Email")
If not objRS.EOF Then
arrEmail = objRS.GetRows()
Else
arrEmail = ""
End If
objRS.Close
Set objRS = Nothing
'***Accountnumber************************************************************************************
Dim arrAccountnumber
Set objRS = conn.Execute("SELECT clientid,Accountnumber,forename,surname from clients where requeststatusid in (1,2) order by Accountnumber")
If not objRS.EOF Then
arrAccountnumber = objRS.GetRows()
Else
arrAccountnumber = ""
End If
objRS.Close
Set objRS = Nothing
response.write "<table border = 0 ><tr height = 10 ><td height = 10 align = right>"
Dim iRow, strVal, strText
If IsArray(arrForename) Then
Response.Write "<form style=""display: inline;"" method= get action = ews_edit_account.asp target=main> Forename <select onchange=this.form.submit() name=clientid STYLE=""color: #FFFFFF; border: none; background: #999999; width: 200px; "">"
For iRow = 0 to UBOUND(arrForename,2) 'this sets the loop from 0 to number of rows in arrData
'This assumes your record set returns 2 values per row. If not use less or more of the below.
strVal = arrForename(0, iRow)
strText = arrForename(1, iRow) & " " & arrForename(2, iRow)
Response.Write "<option value="& strVal &">"& strText &"</option>" & vbcrlf
Next
Response.Write "</select></form>"
End If
response.write "</td><td height = 10 align = right>"
If IsArray(arrSurname) Then
Response.Write "<form style=""display: inline;"" method= get action = ews_edit_account.asp target=main> Surname <select onchange=this.form.submit() name=clientid STYLE=""color: #FFFFFF; border: none; background: #999999; width: 200px; "">"
For iRow = 0 to UBOUND(arrSurname,2) 'this sets the loop from 0 to number of rows in arrData
'This assumes your record set returns 2 values per row. If not use less or more of the below.
strVal = arrSurname(0, iRow)
strText = arrSurname(1, iRow) & "," & arrSurname(2, iRow)
Response.Write "<option value="& strVal &">"& strText &"</option>" & vbcrlf
Next
Response.Write "</select></form>"
End If
response.write "</td></tr><tr><td align = right>"
If IsArray(arrAccountnumber) Then
Response.Write "<form style=""display: inline;"" method= get action = ews_edit_account.asp target=main>Account Number <select onchange=this.form.submit() name=clientid STYLE=""color: #FFFFFF; border: none; background: #999999; width: 200px; "">"
For iRow = 0 to UBOUND(arrAccountnumber,2) 'this sets the loop from 0 to number of rows in arrData
'This assumes your record set returns 2 values per row. If not use less or more of the below.
strVal = arrAccountnumber(0, iRow)
strText = arrAccountnumber(1, iRow) & " (" & arrAccountnumber(2, iRow) & " " & arrAccountnumber(3, iRow) &")"
Response.Write "<option value="& strVal &">"& strText &"</option>" & vbcrlf
Next
Response.Write "</select></form>"
End If
response.write "</td><td align = right>"
If IsArray(arrEmail) Then
Response.Write "<form style=""display: inline;"" method= get action = ews_edit_account.asp target=main>Email <select onchange=this.form.submit() name=clientid STYLE=""color: #FFFFFF; border: none; background: #999999; width: 200px; "">"
For iRow = 0 to UBOUND(arrEmail,2) 'this sets the loop from 0 to number of rows in arrData
'This assumes your record set returns 2 values per row. If not use less or more of the below.
strVal = arrEmail(0, iRow)
strText = arrEmail(1, iRow) & " (" & arrEmail(2, iRow) & " " & arrEmail(3, iRow) &")"
Response.Write "<option value="& strVal &">"& strText &"</option>" & vbcrlf
Next
Response.Write "</select></form>"
End If
response.write "</td></tr></table>"
%>
the above code sits in an iframe, and loads the results of clicking on one of the dropdown items in a page (not shown here) in another iframe.
<iframe width=100% height= 100 frameborder = 0 name=“nav” src=“toes_nav.asp”></iframe>
<iframe width=100% height= 85% frameborder = 0 name=“main” src=“ews_edit_account.asp”></iframe>