View Single Post
  #3   Report Post  
Posted to microsoft.public.word.pagelayout
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default Forms Field Problems

Hi abradaxis,

If you'd like to have the formfield automatically insert a given date as the
default, you could use an 'On Entry' macro coded like:

Sub DefaultDate()
With ActiveDocument
.Unprotect Password:=""
If Not IsDate(.FormFields("Text1").Result) Then
'For Today:
.FormFields("Text1").Result = Format(Date, "d/M/yyyy")
'For 14 days hence:
'.FormFields("Text1").Result = Format(DateAdd("d", 14, Date),
"d/M/yyyy")
End If
.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End With
End Sub

The above macro includes code for both today (active) and 14 days hence
(commented out). Your users would, of course, need to know they can replace
the default date.

Cheers

--
macropod
[MVP - Microsoft Word]


"abradaxis" wrote in message
...
I am preparing a form, using Form Fields. I format a text field as

unlimited
in length, current date, with the option of entering data if necessary.
Then, while inputting the date, Word suggests the current date while I
accept by using the Tab Key. As soon as hit the key, Word responds with a
message that correct date is necessary. How can I get Word to input the
current date, as formatted in the Form Field Properties Box for that

field,
while still retaining the ability to enter another date if I want? And why
is Word giving me an error when I accept its suggested date? Thanks in
advance for any help.