You can actually do this without a macro, using field coding to conditionally display a message in the body of the document. The field code would be:
{IF {End \@ YYYYMMDD} > {Begin\@ YYYYMMDD} "" "Term ending date must be after beginning date."}
Simply check the formfields' 'calculate on exit' property. Some additional field coding could be used to suppress the message when either field is empty.
Note: The field brace pairs (ie '{ }') for the above example are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|