PDA

View Full Version : Unlock a form for further editing withou losing the input data



tammytutone
09-02-2008, 10:18 AM
I have a new form template that I want to unlock after the data in the form fields has been entered. I put a macro in the last field to trigger the unlocking of the form, but once the form is unlocked, the data that the user entered disappears. How can I unlock the form and keep the data which was entered? I have attached the form. To see it work, press tab after making a selection in the very last form field.

macropod
09-02-2008, 10:59 PM
Hi Tammy,

The data that have already been input into the formfields should remain there when the form is unlocked. The problem usually happens when you re-protect the form. You can overcome that with code like
Activedocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="Password"

Chukesgirl
09-03-2008, 08:16 AM
I am having the same issue with a Word 2007 form. What version of Word are you using?

macropod
09-03-2008, 01:55 PM
Hi Chukesgirl,

Word 2007 is no different. To unprotect the document, your macro needs only one line:
ActiveDocument.Unprotect
The normal behaviour for such a document is to leave the contents of the formfields intact.

fumei
09-07-2008, 05:22 AM
Yes. I tab out of the last formfield, and all data entered prior to that last one remains. It is not cleared.

If you use the menu to protect it again, yes THAT will clear the data.

Unless you do NOT use the menu, and use code as macropod gave, with NoReset:=True.

fumei
09-07-2008, 05:23 AM
BTW: that is not a form template.