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

adding contents of 2 fields

Status
Not open for further replies.

Howard2002

Programmer
Aug 2, 2002
12
US
what is the syntex to add the contents of 2 fields? I have a memory variable to store the total.

example
field_a + field_b = mvsum
thisform.txtsum.value = mvsum
 
thisform.txtsum.value = field_a + field_b Attitude is Everything
 
HI
mvsum = field_a + field_b
Hope this helps you :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
I guess according to Ramani's and danceman's answer the fields are numeric and not character, but just in case they are :
Code:
thisform.txtsum.value = VAL(field_a) + VAL(field_b )
 
Thanks to all I through trial and error found thisto work give me your opinion.

store thisform.txtfieldA.value + thisform.txtfieldB.value TO mvsum
thisform.txtsum.value = mvsum

this is in the find button

Thanks to all
 
There is no need for the intermediary memory variable, and most vfp programmers avoid typing all the extra characters of the STORE xxx TO yyy command, but, if you're happy, we're happy. It'll work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top