text form field type: calculations

  • Thread starter Thread starter Jimmie Hall
  • Start date Start date
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?
 
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.
 
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

My web site www.gmayor.com

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

--
Stefan Blom
Microsoft Word MVP


in message
 
Back
Top