Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Problem Again~
Message
 
À
15/12/1999 00:12:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00303844
Message ID:
00303948
Vues:
20
Wai Wai,

Using a parameterized view is easy, I gave you the exact steps to do it in the last message but I'll repeat them here.

Open your database with OPEN DATABASE MyDbc. Then right click on the background and choose New Local View. IN the view designer put your two tables, a dialog will ask you how they are related and you fill it in with the common field.

Then in the fields tab you list each of the fields you want in the view. On the filter tab you put the field you are matching (in this case So_Ho) and under the example column of the field tab you put ?lcSoHo with teh question mark in front of the variable name. You can then set anything else you want about the view.

Then close the view designer and give the view a name, assuming you name the view MyView.

Now open your form. Right click on the form's background and choose Data Environment. Right click the background of the DE and choose Add, form the dialog change the to Views and choose MyView from the list and close the selection dialog. Right click on the view in the DE and choose Properties. Find the property named NoDataOnLoad and set it to .T.

Close the DE. Go to your Grid and set the RowSourceType property to Alias and make the RowSource MyView. Go to the Refresh Method of the grid and write code similar to this;
* Grid's Refresh()
LOCAL lcSoHo
lcSoHo = (Whatever you use to get the value you want the filter based on)
Requery("MyView")
That's all there is to it. It is worth spending some time to learn as parameterized views will be invaluable to you once you understand them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform