Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use Parameterized views in a forms DE
Message
De
16/07/1999 15:38:27
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00242522
Message ID:
00242540
Vues:
19
Roi ---

You probably want the view to look for a form property, ie, Form.MyVal and not a variable. In the Init of the Form:

PARAMETERS vMyVal
THIS.MyVal=vMyVal
=REQUERY("MyView")
THIS.Refresh()

Now, set NoDataOnLoad to .T. for the view in the DE or else you're gonna be asked for the value of Form.MyVal at DO FORM because the DE exists before the form does so the value is unknown. This is why you need the REQUERY in the init after you have set the property value and the THIS.Refresh() is to make sure any bound controls on the form bound to the view show the correct stuff.

Got it?

>How do you a pass a parameter to a form and use that value as the parameter in a view in the forms DE.
>
>example:
>do MyForm with MyVal
>
>in MyForm's init I catch the val and set it to MyVar (the parameter for the view).
>
>However the init happens after the view is queried (right word?) so the user gets prompted for the value.
>
>Any ideas?
>
>TIA
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform