Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Show change inf form a from form B, Private Datasessions
Message
From
04/01/2001 23:20:26
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, United States
 
 
To
04/01/2001 20:32:28
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00459114
Message ID:
00459664
Views:
26
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform