Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculation in Grid - with key board control

Status
Not open for further replies.

sridhar412

IS-IT--Management
Jun 4, 2002
19
IN
hi,

I am new to VFP. I am trying grid with a sample table containing code, qty, rate and value as fields.

When the qty/rate is changed in the grid, i want to update 'value' field.

I have tried "replace value with qty*rate" in beforerowcolchange/afterrowcolchange methods.

This does not work when i change the 'qty' field and use 'UP' or 'DOWN' arrow (ie. moving to next
record).

How do i control this?

sridhar
 
you could put your code in the lostfocus event of the textbox of the grid holding the quanity and rate. Attitude is Everything
 
U can do it using the follg method

1)Set the Control Source property for the Value field to be (Qty*rate)
2)In the lostfocus event of the text box(rate)ay
Replace Value with Qty*rate
This will update the value field in the table and the 1st point will take care of the calculation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top