Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Freddie Fredricks Freddie Fredricks is offline
external usenet poster
 
Posts: 1
Default auto-fill the next 3 fields when selecting text from a dropdown

I currently have 4 dropdown fields on a form: Name - Position - Ext. Email.
I want the Position - Ext. & Email fields to auto-fill with the correct info,
when a name is selected. Note: Each name has unique data for each field. I
am ignorant when it comes to macros, so I need to have my hand held through
this one. Thanks.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default auto-fill the next 3 fields when selecting text from a dropdown

You may not need a macro; this can be done with IF fields, though it can get
pretty messy if there are a lot of names. How many names are there? Provide
some sample names and positions, and I'll provide some sample IF fields.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Freddie Fredricks" Freddie wrote in
message ...
I currently have 4 dropdown fields on a form: Name - Position - Ext.

Email.
I want the Position - Ext. & Email fields to auto-fill with the correct

info,
when a name is selected. Note: Each name has unique data for each field.

I
am ignorant when it comes to macros, so I need to have my hand held

through
this one. Thanks.


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default auto-fill the next 3 fields when selecting text from a dropdown

Essentially you would run a macro on exit from the dropdown field which
would populate the other fields eg

Sub OnExitDD1()
'fills text field based on content of _
dropdown field

Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
Select Case oFld("Dropdown1").Result
Case Is = "Bob"
oFld("Text1").Result = "867-5309"
oFld("Text2").Result=
Case Is = "Joe"
oFld("Text1").Result = "911-1111"
oFld("Text2").Result =

Case Else
'Do nothing
End Select
End Sub

You need a case statement and a set of results for each entry in the
dropdown (which here is bookmarked dropdown1 and fills fields text1 and
text2)

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Freddie Fredricks wrote:
I currently have 4 dropdown fields on a form: Name - Position - Ext.
Email.
I want the Position - Ext. & Email fields to auto-fill with the
correct info, when a name is selected. Note: Each name has unique
data for each field. I am ignorant when it comes to macros, so I
need to have my hand held through this one. Thanks.



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Freddie Fredricks[_2_] Freddie Fredricks[_2_] is offline
external usenet poster
 
Posts: 2
Default auto-fill the next 3 fields when selecting text from a dropdow

I currently have 3 names - 3 postions - 3 Exts & 3 emails (each email is
identical after @...... sample:

[NAME] [POSITION] [EXT] [email]
@abc.com
Willie Smith DIR 111 wsmith
John Jones AD Ops 112 jjones
Gail Storms AD Sales 120 gstorms

Appreciate any help



"Suzanne S. Barnhill" wrote:

You may not need a macro; this can be done with IF fields, though it can get
pretty messy if there are a lot of names. How many names are there? Provide
some sample names and positions, and I'll provide some sample IF fields.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Freddie Fredricks" Freddie wrote in
message ...
I currently have 4 dropdown fields on a form: Name - Position - Ext.

Email.
I want the Position - Ext. & Email fields to auto-fill with the correct

info,
when a name is selected. Note: Each name has unique data for each field.

I
am ignorant when it comes to macros, so I need to have my hand held

through
this one. Thanks.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default auto-fill the next 3 fields when selecting text from a dropdow

Use a dropdown form field for the name, and make sure that the bookmark of
this field (in the Form Field Options) is Name. Then, instead of inserting a
form field for Position, Ext, or Email, use fields such as the following:

For Position:

{ IF { REF Name } = "Willie Smith" "DIR" }{ IF { REF Name} = "John Jones"
"AD Ops" }{ IF { REF Name } = "Gail Storms" "AD Sales" }

For Ext:

{ IF { REF Name } = "Willie Smith" "111" }{ IF { REF Name} = "John Jones"
"112" }{ IF { REF Name } = "Gail Storms" "120" }

For Email:

{ IF { REF Name } = "Willie Smith" "wsmith" }{ IF { REF Name} = "John Jones"
"jjones" }{ IF { REF Name } = "Gail Storms" "gstorms"

Each pair of field delimiters (the things that look like braces but can't be
entered from the keyboard) must be inserted using Ctrl+F9. Note that
"Calculate on exit" must be checked in the Form Field Options for your Name
field, and that users must Tab out of the field (not just click the mouse
elsewhere) for the IF fields to be updated.

In this situation, you may find Graham's macro more practical.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Freddie Fredricks" wrote in
message ...
I currently have 3 names - 3 postions - 3 Exts & 3 emails (each email is
identical after @...... sample:

[NAME] [POSITION] [EXT] [email]
@abc.com
Willie Smith DIR 111

wsmith
John Jones AD Ops 112 jjones
Gail Storms AD Sales 120 gstorms

Appreciate any help



"Suzanne S. Barnhill" wrote:

You may not need a macro; this can be done with IF fields, though it can

get
pretty messy if there are a lot of names. How many names are there?

Provide
some sample names and positions, and I'll provide some sample IF fields.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup so
all may benefit.

"Freddie Fredricks" Freddie wrote

in
message ...
I currently have 4 dropdown fields on a form: Name - Position - Ext.

Email.
I want the Position - Ext. & Email fields to auto-fill with the

correct
info,
when a name is selected. Note: Each name has unique data for each

field.
I
am ignorant when it comes to macros, so I need to have my hand held

through
this one. Thanks.






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default auto-fill the next 3 fields when selecting text from a dropdow

If you prefer the macro solution, then the macro I posted earlier using your
further information would be

Sub OnExitDD1()
'fills text field based on content of _
dropdown field

Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
Select Case oFld("NAME").Result

Case Is = "Willie Smith"
oFld("POSITION").Result = "DIR"
oFld("EXT").Result = "111"
oFld("EMAIL").Result = "wsmith"

Case Is = "John Jones"
oFld("POSITION").Result = "Ad Ops"
oFld("EXT").Result = "112"
oFld("EMAIL").Result = "jjones"

Case Is = "Gail Storms"
oFld("POSITION").Result = "AdSales"
oFld("EXT").Result = "120"
oFld("EMAIL").Result = "gstorms"

Case Else
'Do nothing
End Select
End Sub

Set the bookmark name of the dropdown field to NAME
the bookmark name of the position field to POSITION
the bookmark name of the extension field to EXT
and the bookmark name of the email field to EMAIL

(right click the fields properties)

See http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Freddie Fredricks wrote:
I currently have 3 names - 3 postions - 3 Exts & 3 emails (each email
is identical after @...... sample:

[NAME] [POSITION] [EXT]
[email] @abc.com
Willie Smith DIR 111
wsmith John Jones AD Ops 112
jjones Gail Storms AD Sales 120
gstorms

Appreciate any help



"Suzanne S. Barnhill" wrote:

You may not need a macro; this can be done with IF fields, though it
can get pretty messy if there are a lot of names. How many names are
there? Provide some sample names and positions, and I'll provide
some sample IF fields.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

"Freddie Fredricks" Freddie
wrote in message
...
I currently have 4 dropdown fields on a form: Name - Position -
Ext. Email. I want the Position - Ext. & Email fields to auto-fill
with the correct info, when a name is selected. Note: Each name
has unique data for each field. I am ignorant when it comes to
macros, so I need to have my hand held through this one. Thanks.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill-ins with Dropdown lists? zSplash Mailmerge 3 August 2nd 06 05:25 PM
Auto fill Form Fields from previous Variable fields? OmaScott Microsoft Word Help 3 July 19th 06 09:09 PM
WORD: Dropdown auto link and input into fields Van Microsoft Word Help 1 January 6th 06 02:08 PM
In a form, add "Additional" yes/no box if yes, dropdown & fill-in IDEAS Microsoft Word Help 0 September 19th 05 06:56 PM
How do I auto fill a text field? lauren Microsoft Word Help 1 July 27th 05 09:41 PM


All times are GMT +1. The time now is 04:42 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"