To keep your pages in sync with the database and produce a user-friendly result:
* populate the droplist boxes with current information; * make the droplist box a subroutine that can be reused; * sort and filter the list before showing it as ouput.
Here's how to do it:
Build the subroutine that will generate the droplistbox.
<% '************************************ 'Subroutine for droplist box ' 'PURPOSE: Reusable code to be called for placement of droplist box ' in a form or page ' 'PARAMETERS: 'strSQL = Defines SQL statement 'strFieldName = Defines field name in database table 'strDefault = Defines default value in droplist 'StrBoxName = Defines name of droplistbox 'strBoxTitle = Defines the title shown next to droplist box on screen 'strConn = Defines the database connection string '*************************************
Sub Droplist(strSQL,strFieldName,strDefault,StrBoxName,strBoxTitle,strConn)