Comparing dates in legacy control text box
I have two legacy control fields "Begin" and "End" in a Word 2007 form. I defined the type as "Date" in the text form field options. I was hoping to write a macro that would run on exit from the End date to warn the user if the End date is before the Begin date. I'm not having much luck. I finally had the macro output a message box with the value in the date fields, and no matter the date, the value is always 70.
Am I trying to do something that isn't possible, or am I just too much of a newbie at VBA to figure out how to do it?
Here's what I was trying to do:
Sub End_Date()
'
' End_Date Macro
'
'
If ActiveDocument.FormFields("End") <= ActiveDocument.FormFields("Begin") Then
MsgBox "Term ending date must be after beginning date."
End If
End Sub
Thanks,
Joe
|