I have a Search form where you can input the criteria the user will be searching for. Then when I click the Search button, the query results will show in a separate form. What I want to happen is, show the the query results in the Search form. Does anyone开发者_开发百科 know what I should do (step by step) and the code for it? Thanks!
You can use Allen Browne's Search criteria form example as the basis for your search form. He provides a sample database in Access 2000 format and also a page which displays the code behind the form.
Edit: You wanted your query results presented as a datasheet in the same form. AFAIK, there is no way to display your search control on a form in datasheet view. If a continuous form is acceptable, Mr. Browne's example should be easier for you to adapt. But if you must have the query results in datasheet view, you can add a subform (with its Default View property set to Datasheet) to the search form. However, that approach will require you to apply the filter to the subform rather than the main form.
If you really need a datasheet, you could embed it as a subform in an unbound form, and then put summary fields in the footer of the parent form. This would preserve the user's ability to take advantage of the features of datasheets (as opposed to the continuous form in the example from Allen Browne).
精彩评论