View Full Version : User defined query/ report


mungovan
02-07-2008, 05:54 AM
Hello,

Is there any way of creating a user defined query/ report based on fields in a table? Basically we want a report to be generated based on whatever fields the user enters. So, say we have 30 different fields in a table, the user gets to click on a button that gives them the option to create a report that includes: field1, field2, field3 and where field10 = Blue.
Is this possible to do?

ted.martin
02-07-2008, 06:24 AM
The simple answer is 'yes' but this will involve a fairly complex filtering of the data for up to 30 variables. Writing the report will be complex too. As such, I would try to simplify the way the user selects the filter criteria.

One way I have used in the past is to create an additional yes/no field in the table data (FilterMark) and for each of the values in your filter criteria, run a simple piece of code or an update query to set the FilterMark = True if the criteria is met in the records. All you need to do then is to run the report for all the records where the FilterMark is True.

(Obviously before running this routine, you need to clear all the records back to FilterMark = False ie. another update query.

Hope this helps the thought process.