Im sure this is rediculously simple to most of you, but Im new...
I create a word template (eg invoice) and the userform to populate it, i
have no problems with transfering the data from the form to the document
created from the template. but I cant find any way of adding up the
(numerical) content of selected fields(in the userform) and having the sum
placed in the document created...
eg, value of textbox 3 should equal the value of textbox1 plus value of
textbox2 --- after three days of trying Im getting desparate... hope someone
can help
cheers
url:http://www.ureader.com/gp/1023-1.aspx
Greg Maxey - 11 Dec 2007 15:37 GMT
Colin,
You could use a TextBox Exit event from textbox1 and textBox2.
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.TextBox3 = Val(Me.TextBox1) + Val(Me.TextBox2)
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.TextBox3 = Val(Me.TextBox1) + Val(Me.TextBox2)
End Sub

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> Im sure this is rediculously simple to most of you, but Im new...
>
[quoted text clipped - 10 lines]
>
> url:http://www.ureader.com/gp/1023-1.aspx
colin wilson - 12 Dec 2007 09:53 GMT
Greg,
Many thanks for the advice, I tried using just the line
Me.TextBox3 = Val(Me.TextBox1) + Val(Me.TextBox2)
and it worked great....
(val was the only thing I hadnt tried...)
so easy when you know how...
once again,
many thanks
Colin
url:http://www.ureader.com/msg/1023494.aspx