Word Form Text Claculations

C

Corey

This is my 1st Word Programming question, so here it goes:

I have 3 Form Text Form Fields on a Doc.

I protect the Doc, so ONLY the Text Fields can be selected.

I want the user to input a value in Text1.
Then input a date in Text2(Changed the Properties-Type) to date

Here's my question:
I want Text3, to automatically be 12 months more than the Date in Text2.
And if posible remove the enable entry then to Text2

Is this possible, if so how?
I cannot seem to get the syntax for the Calculation correct.
 
D

Doug Robbins - Word MVP

See fellow MVP Macropod's Date Calc 'tutorial', at:

http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

This is my 1st Word Programming question, so here it goes:

I have 3 Form Text Form Fields on a Doc.

I protect the Doc, so ONLY the Text Fields can be selected.

I want the user to input a value in Text1.
Then input a date in Text2(Changed the Properties-Type) to date

Here's my question:
I want Text3, to automatically be 12 months more than the Date in Text2.
And if posible remove the enable entry then to Text2

Is this possible, if so how?
I cannot seem to get the syntax for the Calculation correct.
 
C

Corey

Doug,
Thanks for the reply.
That info went str8 over my head.

I can see in the Form Field that i can set a Calculation on exit, but i need the Text3 to be the result of the calculation not the Text2.
I cannot seem to get the correct syntax.
I could not solve it with a macro either, as i cannot seem to get the text2 and 3 syntax for the macro to come up error free either.

Corey....
See fellow MVP Macropod's Date Calc 'tutorial', at:

http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

This is my 1st Word Programming question, so here it goes:

I have 3 Form Text Form Fields on a Doc.

I protect the Doc, so ONLY the Text Fields can be selected.

I want the user to input a value in Text1.
Then input a date in Text2(Changed the Properties-Type) to date

Here's my question:
I want Text3, to automatically be 12 months more than the Date in Text2.
And if posible remove the enable entry then to Text2

Is this possible, if so how?
I cannot seem to get the syntax for the Calculation correct.
 
C

Corey

Solved it through another forum.

Ended up with a Run Maco on Exit of Text1 to give the desired result in Text3 with:

~~~~~~~~~~~~~~~~~~~~~
Sub AddYear()
On Error Goto Here
Dim sDate As Date
sDate = ActiveDocument.FormFields("Text1").Result
sDate = Format((sDate + 365))
ActiveDocument.FormFields("Text3").Result = sDate
Here:
End Sub
~~~~~~~~~~~~~~~~~~~~

Yay !

Corey....
Doug,
Thanks for the reply.
That info went str8 over my head.

I can see in the Form Field that i can set a Calculation on exit, but i need the Text3 to be the result of the calculation not the Text2.
I cannot seem to get the correct syntax.
I could not solve it with a macro either, as i cannot seem to get the text2 and 3 syntax for the macro to come up error free either.

Corey....
See fellow MVP Macropod's Date Calc 'tutorial', at:

http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

This is my 1st Word Programming question, so here it goes:

I have 3 Form Text Form Fields on a Doc.

I protect the Doc, so ONLY the Text Fields can be selected.

I want the user to input a value in Text1.
Then input a date in Text2(Changed the Properties-Type) to date

Here's my question:
I want Text3, to automatically be 12 months more than the Date in Text2.
And if posible remove the enable entry then to Text2

Is this possible, if so how?
I cannot seem to get the syntax for the Calculation correct.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top