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 19:15:34
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, United States
 
 
To
04/01/2001 16:53:31
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00459114
Message ID:
00459621
Views:
24
>I tried it and Form A does not see changes made by form B. The program uses >code like (in the valid event) of the text box.

>IF ThisForm.lNewSlip AND This.Value > instock.nqty ;
>AND instock.nmaxlev <> 0
>code for messages
>ENDIF

>How do I get updated value of instock.nqty (i.e. when it is updated by a >different form by the current or a differnt user). Form for maitiaining >inventory data is logically independent of orders form. Since it is not
>a view requery does not seem appropriate. Is it some variant of tableupdate
>(but this form did not update the inventory table), or is some
>variant of the refresh event (if so what).

Well you bring up a couple of issues that will determine your solution:
1. The same user updates instock
2. Another user updates instock

If 2 is likely to happen then refreshing instock with your form's Activate() event won't help you. You might consider querying instock when you need it. Maybe you could create a method called something like:
thisform.StockTooLow( tuRecordID, tnItemValue )

This method will query the instock table for the specified stock item (tuRecordID) and compare it to the user's input quantity (tnItemValue). If instock.nQty is less than tnItemValue then the method returns a .F.

You could then call this method whenever you need it, in the field's Valid() event or right before you save the data. There are other issues involved, like maybe you should create an instock business object that could be reused throughout your application, but the point is to get the latest value of instock.nQty exactly when you need it.

HTH
George Simon, MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform