Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2007

Tip: Looking for answers? Try searching our database.

word template/userform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
colin wilson - 11 Dec 2007 15:29 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.