Create a dbf-file for query conditions.
You can save
- last condition, -or-
- all conditions which user creates, -or-
- such conditions only, which user explicitly saves (named condition)
F.e. if you decide to save named conditions, than maybe good idea is give to the user possibility to save the condition for himselves -or- save it for all users (public condition).
Dbf can have sturcture like:
IsPublic L //for User only -or- public for all//,
User C(20) //who created this//,
AliasName C(20) //see bellow//
UserName C(60) //username, which user uses to find and re-use his condition later//,
Condition M //parts of condition expression separated with delimiters//
Based on AliasName you will filter records in this condition table, f.e. if you display a form to enter a query to find a customer, than filter conditions which user can re-use FOR AliasName='customer' (and if user will crearte new one, save it with AliasName='customer') - so ==Alias==Name is example only. In a fact this identifies current query form inside all query forms.
Format for Condition you have to create. I use it as in following example:
2
|NOT (|Country|=|'USA'||
OR||Country|=|'Canada'|)|
which mean: condition is created from 2 subconditions, on each row is one subcondition. Whole condition is NOT (Country='USA' OR Country='Canada')
If user decides re-use the condition later, he finds its user name in the list. Then I read Condition memo field into object properties, which are controlsources in the form used to build query - that way the saved query appears on the form, user can just press OK(or Find) to retrieve records, or he can edit the query a little.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.