Re: forms : auto-complete fields based on another field's entry

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi ericm,

Doing this requires a fairly straight-forward field construction using and IF test for each branch. For example, suppose your formfield's bookmark name is 'Branch' and the formfield is set to 'calculate on exit', then the following could be used:
{IF{=Branch}= 1 "Branch1 Name¶Branch1 address line 1¶Branch1 address line 2¶Branch1 address line 3¶Branch1 phone¶Branch1 fax"}
{IF{=Branch}= 2 "Branch2 Name¶Branch2 address line 1¶Branch2 address line 2¶Branch2 address line 3¶Branch2 phone¶Branch2 fax"}
etc.

If you don't want all the data showing in the same field result, you could split the fields into two or more parts, eg:
{IF{=Branch}= 1 "Branch1 Name¶Branch1 address line 1¶Branch1 address line 2¶Branch1 address line 3"}
in one location, and
{IF{=Branch}= 1 "Branch1 phone¶Branch1 fax"}
in another location.

Replace the pilcrows (ie ¶) in the above with proper carriage returns or line feeds.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"ericm" <ericm@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:73997710-D3A9-4783-826E-4E0F8B76D1C5@xxxxxxxxxxxxxxxx
I searched under the words "macro" and "if" but I did not find what I want,
and I think what I need is a macro for the multiple "if/then" statements.

What I want to do is this : When an entry is made into one field, I want the
other fields to auto-fill based on the first field's entry. For example,
there are six branch locations of an office numbered one through six. Each
branch has a seperate address, phone number, fax number, etc... On the form
there are fields for branch number, address, phone, fax, etc... If "1" is
entered in the branch number field meaning branch number one, then the fields
for address, phone, fax, etc. will auto-fill with the address, name, fax etc
for branch number one. The information will be different for branch 2 and so
on.

Thank you.

.



Relevant Pages

  • Re: One ComboBox for several Bookmarks
    ... I would suggest that instead of using a DropDown formfield at each location, ... you use a Text Formfield and have and Macro that runs on entry to the ... item that is selected in the combobox. ... how can I use the same drop down list for each different bookmark ...
    (microsoft.public.word.vba.general)
  • From: My Nickname test@address.com
    ... nothing else grants you permission to modify or ... To add a new entry to the list, select the position for the new ... bookmark. ... Ente ...
    (sci.crypt)
  • Re: MSCONFIG BOOT UP ERROR
    ... Go here (a good site to bookmark) and search for an article ... >When i have removed any start up entry in msconfig i get a error message ... >This happens every time that i start windows and i have to press any key to ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Previous bookmark
    ... Amy wrote: ... > bookmarked field. ... > field requires an entry, how do I get back to the original bookmark, ... Assuming you have the name of the bookmark in a string variable named ...
    (microsoft.public.word.vba.general)
  • Re: Formula for Word 2003 Table
    ... set their type to 'number' and the default value and format to whatever you want the entry to be displayed as. ... For example, if you've got three Qty fields, they'd be named Qty1, Qty2 and Qty3, respectively. ... set the 'calculate on exit' property for each formfield ...
    (microsoft.public.word.tables)