Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid row column calculation problem
Message
From
16/04/2002 16:52:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Grid row column calculation problem
Miscellaneous
Thread ID:
00645708
Message ID:
00645708
Views:
42
Hi,

I am using following procedure in grid column valid event to calculate each line total value according to qty and price and its working perfectly and calculating running total also perfectly. My problem is when user click on another row and change qty its multiply quantity with last row price where cursor was before coming to this row. How can I solve problem so whenever user change any rows qty or price it should muliply with same row value instead of previous rows value. Please help in detail if possible with reference code.
malloc=0
mnet=0
cfamt=0
If cfqty<=0
	=messagebox('Sorry Positive Value required...',(0+16+0),' ...')			
	return .f.
else
cfqty=thisform.grid1.column5.text1.value
cfamt=thisform.grid1.column6.text1.value

if curreceipt.cfactp <> space(1) AND curreceipt.cfsbcd <> space(6);
			AND curreceipt.cfitem <> space(10) and curreceipt.cfunit <> space(3);
			AND cfqty > 0 AND cfamt > 0
			*cftot=cfqty*cfamt
			thisform.grid1.column7.text1.value=(thisform.grid1.column5.text1.value*thisform.grid1.column6.text1.value)
			thisform.grid1.column7.text1.refresh()		
			
endi

thisform.refresh()
malloc=0
select curreceipt
scan for curreceipt.cfactp <> space(1) AND curreceipt.cfsbcd <> space(6);
			AND curreceipt.cfitem <> space(10) and curreceipt.cfunit <> space(3);
			AND cfqty > 0 AND cfamt > 0
			
			malloc=malloc+cftot
			
			mnet=malloc-mround
			
endscan

thisform.refresh()

endi

****
Thanks & best regards.
Sajjad Ahmad
Next
Reply
Map
View

Click here to load this message in the networking platform