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

Combo box with option group

Status
Not open for further replies.

markdt

Technical User
Feb 15, 2006
63
GB
Hi people,

Im trying to create a dropdown list with a number of areas, which are divided into a group.

I have a table called tblQArea with qareaid, qarea and type.

qarea is a list of all the areas and type is either manufacturing, administration or other.

heres my code so far.

<%Set oRsQArea=Server.CreateObject("ADODB.Recordset")
strSQLQArea = "SELECT DISTINCT qarea, type FROM tblQArea ORDER BY qarea"

oRsQArea.Open strSQLQArea, ConnString

Response.Write "<OPTION>Please Select...</option>"
Do while not oRsQArea.EOF
if rstDBEdit.Fields("tblQArea.QArea") = oRsQArea("qarea") then 'if this is the selected one then display as selected
Response.Write "<OPTION VALUE = '" & oRsQArea ("qarea") & "' SELECTED>"
Response.Write oRsQArea("qarea") & "</Option>"
oRsQArea.MoveNext

else
Response.Write "<OPTION VALUE = '" & oRsQArea ("qarea") & "'>"
Response.Write oRsQArea("qarea") & "</Option>"
oRsQArea.MoveNext
end if
loop
oRsQArea.Close
Set oRsQArea=nothing
Set strSQLQArea=nothing%>

this simply list all the qareas, was wondering if i could group them by the type field?

Any ideas?
 
"create a dropdown list with a number of areas, which are divided into a group"

I dont understand.... do you mean like a grid?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top