General information
Category:
Forms & Form designer
>>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
1 is actually more likely then 2, but either can happen.
>
>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.
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? Still confused.
>
>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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only