Article ID: 235359 - Last Review: August 9, 2004 - Revision: 2.1 ACC2000: Implementing Query-by-Form in an Access ProjectThis article was previously published under Q235359 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access project (.adp). For a Microsoft Access 2002 version of this article, see 286828 (http://support.microsoft.com/kb/286828/EN-US/ ) . On This PageSUMMARY
This article shows you how to use a form to specify the criteria for a query in a Microsoft Access project.
MORE INFORMATION
In an Access database (.MDB), you can use the query-by-form technique (QBF) to create a "query form" in which you enter query criteria. The query form contains blank text or combo boxes, each representing a field in your Access table that you want to query. You make entries only in the boxes for which you want to specify search criteria. For additional information about query by form in an Access database, click the following article number to view the article in the Microsoft Knowledge Base: 209645
(http://support.microsoft.com/kb/209645/
)
How to use the Query-by-form (QBF) technique
You can also implement the query-by-form technique in an Access project. In an Access project, you would use a stored procedure to find the records that you wanted to view, and then you would create an additional form to display the output of the stored procedure.
Creating a Stored Procedure:Follow these steps to create a stored procedure that you will use to return data to one of your forms:
Creating FormsFollow these steps to create two forms in NorthwindCS.adp: You will use QBF_Form to choose search criteria that will be used by the stored procedure (QBFProc) that you saved earlier. frmFinal will display the results returned by QBFProc.
Modifying frmFinalFollow these steps to modify the Input Parameters property of frmFinal. Using Input Parameters allows you to provide information to input parameters in a stored procedure automatically.
For more information about the Input Parameters property, click Microsoft Access Help on the Help menu, type "New Properties" in the Office Assistant or the Answer Wizard, click Search and select InputParameters in the New Properties (Alphabetical List) page. For more information about Transact-SQL (TSQL) and creating stored procedures with input parameters, refer to SQL Server 7.0 Books Online, which is available for download from the following Microsoft Web site: http://download.microsoft.com/download/SQL70/File/2/Win98/En-US/SQLBOL.exe
(http://download.microsoft.com/download/sql70/file/2/win98/en-us/sqlbol.exe)
| Article Translations
|
Back to the top
