rob.lyles
09-02-2009, 12:09 PM
Hi, I have about 30+ report formats saved in my database. Generally I open the table in which the data is stored, filter, open the report, and I update in properties to show my filtered data. I'd like to eliminate these steps by using something like a form to choose my filter criteria and have a command button open and display my report per that criteria. Does anyone know if this is possible?? Thanks!
Rob
pbaldy
09-02-2009, 12:17 PM
Not only possible but very common. Two most common methods are using a wherecondition:
http://www.baldyweb.com/wherecondition.htm
And using a parameter query (references to the form in the criteria).
rob.lyles
09-02-2009, 12:43 PM
Not only possible but very common. Two most common methods are using a wherecondition:
http://www.baldyweb.com/wherecondition.htm
And using a parameter query (references to the form in the criteria).
Ok, please help me to understand where to use this code. On my form, I have 13 fields. I'd like to use any as many of these as I choose to open a new report. Where does the wherecondition come into play? I also have about 30 reports, how does that tie into the code?
pbaldy
09-02-2009, 12:52 PM
When I have a bunch of optional fields, I tend to build a wherecondition similar to the sample database in this FAQ:
http://www.mdbmakers.com/forums/showthread.php?t=4895
The sample is building the entire SQL, whereas for the wherecondition you only need the part after the word "WHERE". If all the reports use the same source, you could also have a combo or listbox that lists the reports, and use that in the OpenReport code.