macropod
Thu Dec 07 05:43:26 CST 2006
Hi Graham,
Yes, I noticed that. Not doing so and messing up the coding is the only
reason I can think of for the syntax error.
Cheers
--
macropod
[MVP - Microsoft Word]
"Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
news:OQ3LxfeGHHA.816@TK2MSFTNGP06.phx.gbl...
> I did suggest he pasted the original from your source document which will
> work as supplied - even to the correct field names.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site
http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> macropod wrote:
> > Hi Bill,
> >
> > If you used the field coding Graham posted, you need to ensure all
> > the field braces (i.e. '{ }') are created in pairs via Ctrl-F9.
> > Simply typing them won't work and will produce syntax errors just
> > like you described.
> >
> > Cheers
> >
> >
> > "Bill Foley" <pttincatitexasdotnet> wrote in message
> > news:OYX%23OGVGHHA.3616@TK2MSFTNGP02.phx.gbl...
> >> Kept getting some sort of "syntax error" so I gave into the other
> >> way. Must not be smart enough to use the "official field" method!
> >> HA!
> >>
> >> THANKS!
> >>
> >> --
> >> Bill Foley
> >> Microsoft PowerPoint MVP
> >> Microsoft Office Specialist Master Instructor
> >> www.pttinc.com
> >> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
> >> news:%230k3LbUGHHA.1240@TK2MSFTNGP03.phx.gbl...
> >>> If you don't mind Jezebel's unwarranted scorn, you could do this
> >>> with a Word field assembly as opposed to a form field for the
> >>> result. The construction is :
> >>>
> >>> {={SET a{=INT((14-{EndDate \@ M})/12)}}{SET b{={EndDate \@
> >>> yyyy}+4800-a}}{SET c{={EndDate \@ M}+12*a-3}}{SET d{EndDate \@
> >>>
d}}{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045}-{SET
> >>> a{=INT((14-{StartDate \@ M})/12)}}{SET b{={StartDate \@
> >>> yyyy}+4800-a}}{SET c{={StartDate \@ M}+12*a-3}}{SET d{StartDate \@
> >>> d}}{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045}\#
> >>> ,0}
> >>>
> >>> www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902 will give
> >>> you the source document containing the fields to avoid trying to
> >>> reconstruct from here. Don't forget to check the calculate on exit
> >>> check boxes of the two date source fields.
> >>>
> >>>
> >>> --
> >>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>> Graham Mayor - Word MVP
> >>>
> >>> My web site www.gmayor.com
> >>> Word MVP web site
http://word.mvps.org
> >>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>>
> >>>
> >>>
> >>> Bill Foley wrote:
> >>>> Hey Gang,
> >>>>
> >>>> Word 2003
> >>>>
> >>>> Trying to create an automated form for my church and am stumped as
> >>>> to how to do this. I have a calendar form (actually two of them)
> >>>> that populate formfields (StartDate and EndDate). I have another
> >>>> formfield (TotalDays) that I cm trying to populate with the number
> >>>> of days difference between the other two formfields. I assigned
> >>>> the following macro to the "Entry" of the TotalDays field.
> >>>> However, it is not working.
> >>>> Sub CalculateTotalDays()
> >>>> ActiveDocument.FormFields("TotalDays").Result = DateDiff("d",
> >>>> EndDate, StartDate)
> >>>> End Sub
> >>>>
> >>>> I am assuming that Word can't recognize formfields the same way
> >>>> Acces does to know to use them in the calculation, but I can't
> >>>> seem to find a way to make it work.
> >>>>
> >>>> Any ideas? TIA!
>
>