Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Show change inf form a from form B, Private Datasessions
Message
De
04/01/2001 23:20:26
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, États-Unis
 
 
À
04/01/2001 20:32:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00459114
Message ID:
00459664
Vues:
27
>This is the part I am having trouble with. Currently inventory table instock
is the data environment of both forms. Should it be? Then how does the method
access lastest value of nqty in instock?

Since I don't know all of the functionality that's built into Form A it's hard for me to say if you should open the instock table. (For example, Form A may adjust the instock.nQty when you save the order.) But for the lookup validation, I prefer to use views like this:

Create your view...

CREATE SQL VIEW lv_InStockItem AS ;
SELECT * FROM instock ;
WHERE instockID = ?vp_InStockID

Now in the StockTooLow() method :

FUNCTION StockTooLow
LPARAMETERS tnInStockID, tnCheckValue

*-- set your view parameter.
LOCAL vp_InStockID
vp_InStockID = tnInStockID

*-- Skip this part if you open the view in the form's Load().
IF NOT USED('lv_InStockItem')
USE lv_InStockItem IN 0 NODATA
ENDIF

*-- Now get the latest data.
REQUERY('lv_InStockItem')

*-- Now do your validation....


By requerying the view you will get the most current data.

HTH
George Simon, MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform