Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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 Microsoft Advisory Services. For more information, visit these Microsoft Web sites:

Microsoft Certified Partners - https://partner.microsoft.com/global/30000104

Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

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


Keywords: KB265309, kbhowtomaster, kbhowto

↑ Back to the top

Article Info
Article ID : 265309
Revision : 4
Created on : 11/23/2006
Published on : 11/23/2006
Exists online : False
Views : 261