Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WORD FORM FIELD

Status
Not open for further replies.

rfhall3

Programmer
Feb 7, 2003
28
US
I am trying to automate a standard office form. My form basically has 2 fields. The form works great .... EXCEPT ...

I want to enter data for field 1, then have the option to either accept the same value in field 2, OR overtype it with a different value.

Thanks to previous help here, I know how to insert the value from field 1 into field 2 (using Ctrl-F9 then the field name), but this does not allow me to tab to the field and change it. I have tried to enter "{ field1 }" in the properties/default value for field 2, but this obviously didn't work.

Help Please !

Thank you in advance.
 
You are using fields, or formfields?

Gerry
 
I am using Text Form Fields from the "Forms" Toolbar. Nothing real fancy, just fill in the form, print, and do it again !

Thank You.

Bob
 
if you are using Ctrl-F9 in the second field, then you are Calculating on Exit. This will SET the value of field2. It is stating what the value is. So, as you have discovered, you can not edit it.

Instead, write an OnExit macro for text formfield 1. Write it a code module, then set it as the OnExit macro for formfield1.
Code:
Sub UpDateField2()
ActiveDocument.FormFields("[i]secondformfieldname[/i]").Result = ActiveDocument.FormFields("[i]firstformfieldname[/i]").Result
End Sub
This will copy the text of field1 into field2, but still allow field2 to be edited.

Gerry
 
Gerry ...

Thank you very much. Worked first time! Getting a basic macro running really opens up a lot of possibilities.

Again ... Thank You !

Bobby
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top