Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locate data and display to grid
Message
 
À
30/04/2004 01:14:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00899609
Message ID:
00899633
Vues:
16
There is several ways:
1. In InteractiveChange event of the combo You can set FILTER to the table:
cFilt = "MyTable.Field = "+ALLTRIM(STR(this.Value)) && if the value of the combo is numeric
cFilt = "MyTable.Field = '"+ALLTRIM(this.Value)+"'" && if the value of the combo is string
SELECT (thisform.Grid1.RecordSource)
SET FILTER TO &cFilt
GO TOP
thisform.Grid1.Refresh()
but depending of number of records of that table this may be a very slow method

2. Create a parametrised local view, & refresh it in Interactivechage of the combo
3. Set the RecordSourceType of the grid to 4 (SQL Statement), and in trhe interactiveChange dinamicly change the SQL statement. Something like that:

in InteractiveChange method of the combo:
thisform.Grid1.RecordSource = "SELECT * FROM YourTable WHERE KeyField = "+this.Value
thisform.Grid1.Refresh()
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform