Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GETNEXTMODIFIED with new records
Message
From
12/06/1998 17:34:56
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00106948
Message ID:
00107739
Views:
36
That's it. For a new record I do a lookup with an empty value (="") and of course it isn't found so doesn't enter the IF..ENDIF. I moved the SELECT nad it works fine. Thanks for all your help. I found it around the same time thanks to John. BTW Menachem, was that the translation you were looking for?


>>Okay - this is removeqty (addqty is identical except it adds lnqty instead of subtracting it.
>>
>>LPARAMETERS lseekvalue, lnqty
>>
>>LOCAL lcOldAlias, ;
>>	  lnoldrecno, ;
>>	  lcoldnear, ;
>>	  lcoldexact, ;
>>	  lcoldorder
>>
>>lnoldrecno = RECNO()
>>lcOldAlias = ALIAS()
>>lcoldorder = ORDER()
>>lcoldnear = SET("NEAR")
>>lcoldexact = SET("EXACT")
>>SET EXACT ON
>>SET NEAR OFF
>>WITH thisform.grdpolines
>>	SELECT Item_Master
>>	SET ORDER TO TAG itemnumber
>>	SEEK lseekvalue
>>	IF FOUND()
>>		SELECT ItemWarehouse
>>		SET ORDER TO TAG Itemwhse
>>		SEEK lseekvalue+thisform.cbowarehouse.value
>>		IF FOUND()
>>			IF thisform.chkdropship.value
>>				REPLACE Itemwarehouse.dropshiponorder WITH Itemwarehouse.dropshiponorder - lnqty
>>			ELSE
>>				REPLACE Itemwarehouse.qtyonorder WITH Itemwarehouse.qtyonorder - lnqty
>>			ENDIF
>>		TABLEUPDATE(.F.)
>>		ENDIF
>>		SELECT (lcOldAlias)
>>		SET ORDER TO TAG &lcoldorder
>>		.refresh()
>>	ENDIF
>>ENDWITH
>>SET NEAR &lcoldnear
>>SET EXACT &lcoldexact
>
>Bruce,
>
>I think I have it. In your method, you are changing the alias to Item_Master. You only change it back, however, if the value is Found(). Try putting SELECT (lcOldAlias) at the end of the method. Just add the line of code, don't change anything else, and then see what happens.
>
>HTH
***************************
Bruce Gilmour

"Two things are infinite, the Universe and human stupidity. And I am not sure about the Universe."
- Albert Einstein
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform