then to useCode:sub comboMaker(varSQL, varID, varField, varSelected) ' This sub creates a generic combo box with values from a table set rsDD = GetRS(varSQL) 'See recordset and connection function in this same forum do while not rsDD.eof response.Write("<option value=""" & rsDD(varID) & """") if varSelected <> "" then if cstr(rsDD(varID)) = cstr(varSelected) then response.Write(" selected ") end if end if response.Write(">" & rsDD(varField) & "</option>" & vbCrLf) rsDD.MoveNext loop end sub
Code:strSQL = "SELECT intID, strField FROM tbl_TableName ORDER BY strField" response.Write("<select name=""testDropDown"">" & vbCrLf response.Write(vbTab & "<option value="""">Select ....</option>" & vbCrLf Call comboMaker(strSQL, intID, strField, request("testDropDown")) respone.Write("</select>")



LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks