text form field type: calculations

J

Jimmie Hall

I am trying to create a form using Microsoft Word. My templet only uses text
form fields and drop down boxes. In one of my text boxes' "properties", the
text form field type is current date (in the text form field properties it is
bookmarked as "text3"). In my next text form field (book marked as "text4") I
want it to show on the form as the current date in "text3" plus 7 week days.
For example: 1/24/2008 in "text3". In "text4" 1/31/2008. What calculation
goes in the EXPRESSION box if the text form field type is a calculation?
 
S

Stefan Blom

Sorry, I didn't read the original question very carefully. You cannot do this
calculation in the form field options dialog box. I believe an "On exit"
macro is required. You may want to ask in a programming newsgroup such as
microsoft.public.word.vba.general.
 
G

Graham Mayor

You can do it with a calculated field (not a calculated form field) which
your link to my web site would demonstrate, but if you want the information
in a form field, you would need an exit macro eg

Sub Add7()
Dim sDate As Date
sDate = ActiveDocument.FormFields("Text3").Result
sDate = Format((sDate + 7))
ActiveDocument.FormFields("Text4").Result = sDate
End Sub

Set both form fields as 'date' type with the formatting switch as
appropriate.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Stefan Blom

Graham, thank you for "filling in the gaps" in my reply. :)

--
Stefan Blom
Microsoft Word MVP


in message
 

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