Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search Form
Message
De
12/05/1998 17:31:42
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00098418
Message ID:
00098871
Vues:
28
>What is the best way to implement a search form? In my mind, I see
>the program working this way: the user calls up a specific form say
>for products, they click on the search icon on the toolbar, a
>search form appears, the user types in the search criteria and the
>the other form is pointed to the "search" record and the form
>refreshed.

Very good, that is a neat solution.

> Would this type of scenario be best accomplished by using
>a form set?

Oh no, that would mean you could not REUSE the search form to search *any* database.
After all, one of the benefits we are supposed to get in this brave new world of objects is reuse!


>I tried to make an independent search form, but couldn't
>see a way to have both forms interact with the same database.

Aha, Andy Kramek and I were discussing just this problem in the latest KitBox column we wrote for FoxTalk.
Unfortunately it's not going to be printed for a while...


Forms use DATASESSIONS. Most often we use PRIVATE datasessions.
So that one form is totally independent of other forms.
That is a Good Thing[TM] as you can use the same form more than once (it's modeless).

What you would need to go is give the Search form the name of the table it should search.
Let the search form work in its own private data session.
And the Search form should return to the calling form the PRIMARY KEY of the record it should SEEK to.

The search form would have to be modal for this to work, so that execution of the calling form's method (that was probably invoked form a button) STOPS and the search form stays on top.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform