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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP7: Update Column and SUM

Status
Not open for further replies.

cj001

Programmer
Oct 3, 2001
145
US
On my form I have a Grid that displays the following information:

bdate depamt deprttl
09/01/03 25.00 25.00
09/02/03 25.00 50.00
09/02/03 10.00 60.00

Now I need to update a depamt

bdate depamt deprttl
09/01/03 25.00 25.00
09/02/03 25.00 50.00
09/02/03 20.00

Where do I place the SUM code to update the deprttl column? I have tried it in various places, but it refuses to update.

This is the code:
SUM blkbook.depamt TO m.adepamt
ThisForm.grid1.Column3.text1.value = ThisForm.grid1.Column2.text1.value + m.adepamt

THANKS!
CJ
 
cj001

Put the code in the valid event of the textbox who's value is changed, but rather then updating the text.value, you may want to update the cursor (or table) behind the grid, since updating the text.value might give you an unwanted result (ie the same value in all textboxes).

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top