Microsoft KB Archive/247823

= ACC2000: How to Find a Record from a Drop-down List in a Data Access Page =

Article ID: 247823

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q247823



Moderate: Requires basic macro, coding, and interoperability skills.

For a Microsoft 2002 version of this article, see 285353.



SUMMARY
This article shows you how to find a record in a data access page based on an entry that you select from a drop-down list.



MORE INFORMATION
To create the data access page and the appropriate script to find a selected record, follow these steps:  Open the sample database Northwind.mdb. In the Database window, click Pages under Objects, and then double-click Create data access page by using wizard. Under Tables/Queries, click the arrow, and then click Table: Customers in the list. Click >> to move all the fields from the Available Fields list to the Selected Fields list. Click Finish. In the toolbox, click Dropdown List, and then click anywhere on the page to add the Dropdown List control.</li> Set the following properties for the Dropdown List control:

ID: CustID

ListRowSource: Table: Customers

ListBoundField: CustomerID

</li> Right-click anywhere on the page, and then click Microsoft Script Editor on the shortcut menu to open the HTML source.</li> On the View menu, point to Other Windows, and then click Script Outline. This places the focus in the Script Outline window pane, at the top-most node that is labeled Client Objects & Events. Expand Client Objects & Events, expand CustID, and then double-click the onchange event.</li>  Insert the following script: <SCRIPT LANGUAGE=vbscript FOR=CustID EVENT=onchange>

</SCRIPT> NOTE: To search for numeric data, change the command line in the script as follows: rs.Find "[CustomerID] = " & document.all.item("CustID").value </li> Save the page as Page1.htm, and then click Page View on the View menu.</li> Click a value in the CustID drop-down list to move the data access page to that record.</li></ol>

Additional query words: inf dap mod dhtml search move to

Keywords: kbhowto kbdap kbdapscript KB247823

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.