Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sum textbox1.value + testbox2.value
Message
From
09/08/2009 08:19:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01416905
Message ID:
01416907
Views:
67
This message has been marked as the solution to the initial question of the thread.
>I want to sum textbox1.value + testbox2.value
>and store this values in text3, as the user type values
>
>All textboxes are has values from tables, not variables
>
>I put this in interactivechange and kepress methods but could not see
>result in field3. Looks like operation lock the textbox
>
>store field1 + field2 to field3
>Thisform.refresh

In the sample code you provided, you omitted the .Value part.

You can store directly to the textbox:
ThisForm.TxtField3.Value = ThisForm.TxtField1.Value + ThisForm.TxtField2.Value
Refresh is not required in this case.

If you want to save to the underlying field, STORE won't work - that will create a variable with same name instead. Use the REPLACE command instead:
replace Field3 with Field1 + Field2
ThisForm.Refresh()
* or refresh only the TextBox:
* ThisForm.TxtField3.Refresh()
I am assuming the fields are called Field1, Field2, and Field3, and I am naming the textboxes after the fields (Txt + fieldname).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform