how to show query results in a datasheet in the same form?

ぃ、小莉子 提交于 2019-12-25 01:38:07

问题


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!


回答1:


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.




回答2:


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).



来源:https://stackoverflow.com/questions/5827047/how-to-show-query-results-in-a-datasheet-in-the-same-form

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!