Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to keep query forms filter options for use later

Status
Not open for further replies.

kosta

Programmer
Feb 9, 2001
186
CA
Hi All,
i want to give to users , that they can be save query forms filter options to a file for later use and can be call its later ?

How is your suggestions ?

TIA

Soykan OEZCELIK
 
Hi All,
i've solved my need like below,

i am putting to the forms controls of controlsource m.myvar1,m.myvar2 ..

for save button "SAVE TO myfilter ALL LIKE myvar*"
for load filter button "RESTORE FROM myfilter ADDITIVE"




Soykan OEZCELIK
 
kosta;

If all you want to save is the filter settings, all you need to do is:
Code:
 lcSaveFilter = SET("FILTER")

Now store lcSaveFilter to where ever you want i.e. dbf, .txt file, etc.

To restore the setting:

Code:
SET FILTER TO &lcSaveFilter

HTH

Ed

Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top