<SCRIPT LANGUAGE=VBSCRIPT RUNAT=SERVER> Public Sub BuildComboBox(rs, dispname, val, name, selected) 'rs = the recordset 'dispname = fieldname to display in the user control 'val = fieldname to place in the val of the option 'name = name of the select (cboBox) 'selected is the item in the lst that should be selected 'response.write (val & " ' " & dispname & " ' " & name) rs.movefirst response.write("<SELECT NAME=" & name & ">" & vbCrLf) while not rs.eof if rs.fields(val).Value = selected then response.write("<OPTION VALUE=" & rs.fields(val) & " selected>" & rs.fields(dispname) & "</OPTION>") response.write(vbCrLf) else response.write("<OPTION VALUE=" & rs.fields(val) & ">" & rs.fields(dispname) & "</OPTION>") response.write(vbCrLf) end if rs.MoveNext wend response.write("</SELECT>" & vbCrLf) End Sub </SCRIPT>