M
Mark Andrews
Hi, I'm designing an application that lets the user use a variety of forms
to basically build queries.
The users will be using the Access runtime and will not have any knowledge
of sql or Access.
Example: User uses my forms to build a query to return
Show contacts who have a status of 'Active'
and who have any donation date greater than 1/1/2009
For the user I call it:
- a filter is the entire query
- a criteria set is a set of criteria (these are considered all AND)
- you can have one or multiple criteria sets (these are all OR)
- you can also have Show/No Show criteria sets (AND NOT)
All criteria return ContactsIDs and the end result is used to filter down
the list of contacts for viewing/reporting
My question is on the approach.
- table design to store everything no problem
- forms to allow users to pick various type of fields
(example: text lets you pick choices from a multi-select list, number lets
you choose <>= betweeen etc...) no problem
At some point the filter (filtersets and filter criteria records) need to be
transformed into a query so I can use it to join to tblContact to return a
subset of contacts.
Note: One concept that complicates matters:
There are three main types of filter criteria (contact related, donation
related, pledge related).
- Contact related work off a query for contact data or summary data for each
contact
- Donation related work of the related donations records and then group by
contactid to get the list of contacts
- Pledge related work similar to donation except off pledges
So in my example:
Show contacts who have a status of 'Active'
and who have any donation date greater than 1/1/2009
the first line is a contact filter criteria and the second line is a
donation filter criteria
This is a ONE FilterSET example with 2 FilterCriteria lines (pretty simple
example)
My current design/idea is to do the following:
- build actual queries (1 to 3 queries for the filter criteria) and one to
join these queries if needed (for each FilterSET) (building using
CreateQueryDef etc...)
- Then if you have multiple Filtersets another query is used to UNION the
filtersets together (one for Show and one for No Show)
- If you have both Show and NO Show criteria another query to join the Show
and No Show queries appropriately to shwo the correct records
So for a large Filter (you might end up having 20 queries created all via
code).
Is this the best approach? What other ideas would work. Keep in mind a
"Filter"'s end goal is just to be a list of ContactIDs so that it can be
joined into the mix to help with reporting or viewing sub-sets of data.
Thanks in advance,
I hope this made sense and is not too difficult to follow or get any
replies,
Mark
to basically build queries.
The users will be using the Access runtime and will not have any knowledge
of sql or Access.
Example: User uses my forms to build a query to return
Show contacts who have a status of 'Active'
and who have any donation date greater than 1/1/2009
For the user I call it:
- a filter is the entire query
- a criteria set is a set of criteria (these are considered all AND)
- you can have one or multiple criteria sets (these are all OR)
- you can also have Show/No Show criteria sets (AND NOT)
All criteria return ContactsIDs and the end result is used to filter down
the list of contacts for viewing/reporting
My question is on the approach.
- table design to store everything no problem
- forms to allow users to pick various type of fields
(example: text lets you pick choices from a multi-select list, number lets
you choose <>= betweeen etc...) no problem
At some point the filter (filtersets and filter criteria records) need to be
transformed into a query so I can use it to join to tblContact to return a
subset of contacts.
Note: One concept that complicates matters:
There are three main types of filter criteria (contact related, donation
related, pledge related).
- Contact related work off a query for contact data or summary data for each
contact
- Donation related work of the related donations records and then group by
contactid to get the list of contacts
- Pledge related work similar to donation except off pledges
So in my example:
Show contacts who have a status of 'Active'
and who have any donation date greater than 1/1/2009
the first line is a contact filter criteria and the second line is a
donation filter criteria
This is a ONE FilterSET example with 2 FilterCriteria lines (pretty simple
example)
My current design/idea is to do the following:
- build actual queries (1 to 3 queries for the filter criteria) and one to
join these queries if needed (for each FilterSET) (building using
CreateQueryDef etc...)
- Then if you have multiple Filtersets another query is used to UNION the
filtersets together (one for Show and one for No Show)
- If you have both Show and NO Show criteria another query to join the Show
and No Show queries appropriately to shwo the correct records
So for a large Filter (you might end up having 20 queries created all via
code).
Is this the best approach? What other ideas would work. Keep in mind a
"Filter"'s end goal is just to be a list of ContactIDs so that it can be
joined into the mix to help with reporting or viewing sub-sets of data.
Thanks in advance,
I hope this made sense and is not too difficult to follow or get any
replies,
Mark