Friday, August 20, 2010

MS Access search form -> open report?

scenario:





FormName:frmSearch


objects: (all unbound)


txtBeginDate


txtEndDate


cboNameList (contains Names from tblNameList onLoad event)


cboCategoryList (contains Category from tblCategoryList onLoad event





() Show Detailed report (option bution to open dtlMonthlyReport)


() Show Summarized report (option bution to open smrMonthlyReport)


() Search Reciept (option button to open rcptReport)


() Search Voucher (option button to open vcrReport)





btnSearch





[ I want to display search result here within the form ... but dont konw how?]





================= end of frmSearch ==============


notes:


all the reports are link to its own form and the date field formated to accept input from within the form





the purpose of this form (frmSearch) is to show the search result based on user defined criteria and then from the search result user can double click to open the designated report with the parameters from the sellected search result.





question:





1) how do I display the search result(s) within the form itself (in VB its dataGrid) for the option 3 %26amp; 4 only.


2) I have tried using the ';SELECT '; method in sqlCriteria string using


doCmd.OpenReport .......,sqlCriteria


but an error msg appears saying ';....there are more than 1 record based on ..... consider using EXISTS reserved word ......';


So how do I open the designated report based on the search criteria?





I have heard of this PARAMETERS in querydef but not sure how to use it.





can you guys help me? Im stuck. whenever I want to display the reciept of a certain transaction I have to manually browse to the records (in frmTransaction) then click the button to generate the report. The same goes to the monthly detailed report, where I have to execute the form , enter the date range and click the button. For the summarized report its more troublesome for me to generate the report because it goes through many process. That is why i want to have this ';short cut';MS Access search form -%26gt; open report?
dont look for a shortcut please.

No comments:

Post a Comment