Forms Field Problems

A

abradaxis

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.
 
S

Stefan Blom

A lot of features are unavailable in a protected document. I suspect
what you are seeing is a result of that: As you press the Tab key,
instead of performing autocomplete, Word tries to move to the next
form field, which generates an error message because the format of the
date form field will be incorrect.

The simplest fix would be to just type the date in, ignoring the
autocomplete suggestion. You may want to turn off the autocomplete
feature (on the AutoText tab of the Tools | AutoCorrect Options dialog
box), to reduce confusion. Note, however, that this is *not* a
document setting; it has to be done for all Word installations
(users).

You may want to ask in a programming newsgroup if there is a macro
workaround.

--
Stefan Blom
Microsoft Word MVP


in message
news:%[email protected]...
 
M

macropod

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
 
Top