HOW TO: Create a Drop-Down List with Multiple Data Columns in FrontPage 2000 (265309)



The information in this article applies to:

  • Microsoft FrontPage 2000

This article was previously published under Q265309

SUMMARY

This article explains how to create a drop-down list box in a Microsoft FrontPage web that displays more than one field or column. For example, you may want to show both FirstName and LastName columns from a database table in such a list box. Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site: back to the top

Multiple Data Column Drop-Down Lists

Drop-down selection lists typically draw their information from a database table and, by default, display only one column of data. If you want to display more than one data column in the list, you need to modify the code that is created by the Insert Database Wizard in FrontPage 2000.

To create a drop-down list box that displays both the FirstName and LastName columns from the Employees table of the Northwind sample database, follow these steps:
  1. Start FrontPage 2000; on the File menu, point to New, click Web, click One Page Web, and then click OK.
  2. On the Insert menu, point to Database, and then click Results.

    NOTE: If Database is not available on the Insert menu, you need to import a database into your web.
  3. In the Database Results Wizard - Step 1 of 5 dialog box, select Use a sample database connection (Northwind), and then click Next.
  4. In the Step 2 of 5 dialog box, select the Record Source box, select Employees, and then click Next.
  5. In the Step 3 of 5 dialog box, click Edit List and remove all fields except FirstName and LastName from the displayed fields box. Click OK, and then click Next.
  6. In the Step 4 of 5 dialog box, select Drop-Down List - one record per item in the Choose formatting options for the records returned by the query box, and then click Next.
  7. Finish the rest of wizard instructions and click Finish.
  8. Click the drop-down list box, and then click the HTML tab.
  9. In the highlighted section, locate the following line of code
    <%=FP_FieldHTML(fp_rs,"FirstName")%>
    						
    and revise it to the following:
    <%=FP_FieldHTML(fp_rs,"LastName") & ", " & FP_FieldHTML(fp_rs,"FirstName")%>
    						
    NOTE: Before modification, the code may show either "FirstName" or "LastName," depending on the order in which you selected these items in the Step 3 of 5 dialog box.

    NOTE: If you copy and paste code on the HTML tab, you may find that special characters, such as ampersands (&) and angle brackets (< and >) are converted into their HTML equivalents (&amp;, <, and >). If so, you need to copy the code into a blank Notepad document, and then copy it from Notepad and paste it into FrontPage.
  10. Save the page and preview it in your browser.

    NOTE: You must preview in your browser; the Preview tab does not display the drop-down list in its viewable form.
back to the top


REFERENCES

For more information about importing databases, click Microsoft FrontPage Help on the Help menu, type import a database in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
back to the top

Modification Type:MajorLast Reviewed:10/27/2002
Keywords:kbhowto kbHOWTOmaster KB265309