Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Thisform Gotchas! Wow!
Message
 
À
06/12/2000 22:32:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00450216
Message ID:
00450706
Vues:
30
David,

First, Thisform is a relative reference to a fomr object that only has meaning in code that is "IN" the form. Your UDF is NOT IN the form so the Thisform means nothing in your UDF. When your UDF is running the filter cannot see THISFORM. Using Thisformin a filter is an invitation to the very error you report.

Instaed put the value of ther propety into the filter directly using a macro or an evaluate() as below;
lcValue = Thisform.Property
SET FILTER TO Filed = EVALUATE(lcValue)
This way the filter is not depentand on either the Thisform being relavant nor the variable lcValue being in scope.

As for the COUNT, there are a number of fox commands that don't respect the WITH stuff, LOCATE for example.

As for the modal form you refered to, well when the COUNT runs the fil;ter needs to be evaluated and the filter is being evaluated in the modal fomr so Thisform refers to that one then. See above to fix that.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform