#1   Report Post  
Posted to microsoft.public.word.docmanagement
gotta question gotta question is offline
external usenet poster
 
Posts: 20
Default Auto populate a field?

I want to be able to have users select their employer from say a drop-down
list, then once either of the employers is selected, their address shows up
on the next line. I made an attempt at an 'if' statement, but it was way too
long and the formula bar wouldn't accept it. I want to do this to avoid
having to use two different forms depending on which employer they work for.
Select employer, auto complete the address for them...easy. Or is it?? LOL!!
I have no idea when it comes to programming, and it seems anything I knew
about macros has also been lost soemwhere along my journey from school to
being almost 40
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Auto populate a field?

The following can be used to set the value of another formfield based on the
item selected from the drop down in such a form

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name

'

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name

Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Co mpany).Value

ActiveDocument.FormFields("Text1").Result = Address



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"gotta question" wrote in message
...
I want to be able to have users select their employer from say a drop-down
list, then once either of the employers is selected, their address shows
up
on the next line. I made an attempt at an 'if' statement, but it was way
too
long and the formula bar wouldn't accept it. I want to do this to avoid
having to use two different forms depending on which employer they work
for.
Select employer, auto complete the address for them...easy. Or is it??
LOL!!
I have no idea when it comes to programming, and it seems anything I knew
about macros has also been lost soemwhere along my journey from school to
being almost 40



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
gotta question gotta question is offline
external usenet poster
 
Posts: 20
Default Auto populate a field?

So would I insert a field and somehow paste that macro in there? I haven't
attempted a macro since wordperfect

Also, is there a way to get he document to not warn against macros, so users
can't disable them? (In relation to having to add this macro to it). I hope
you're still 'listening'! You sound like you know your siht!!

"Doug Robbins - Word MVP" wrote:

The following can be used to set the value of another formfield based on the
item selected from the drop down in such a form

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name

'

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name

Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Co mpany).Value

ActiveDocument.FormFields("Text1").Result = Address



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"gotta question" wrote in message
...
I want to be able to have users select their employer from say a drop-down
list, then once either of the employers is selected, their address shows
up
on the next line. I made an attempt at an 'if' statement, but it was way
too
long and the formula bar wouldn't accept it. I want to do this to avoid
having to use two different forms depending on which employer they work
for.
Select employer, auto complete the address for them...easy. Or is it??
LOL!!
I have no idea when it comes to programming, and it seems anything I knew
about macros has also been lost soemwhere along my journey from school to
being almost 40




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Auto populate a field?

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

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

"gotta question" wrote in message
...
So would I insert a field and somehow paste that macro in there? I haven't
attempted a macro since wordperfect

Also, is there a way to get he document to not warn against macros, so

users
can't disable them? (In relation to having to add this macro to it). I

hope
you're still 'listening'! You sound like you know your siht!!

"Doug Robbins - Word MVP" wrote:

The following can be used to set the value of another formfield based on

the
item selected from the drop down in such a form

' Macro created 15-11-97 by Doug Robbins to add the address

corresponding to
a drop down name

'

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name

Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Co mpany).Value

ActiveDocument.FormFields("Text1").Result = Address



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"gotta question" wrote in

message
...
I want to be able to have users select their employer from say a

drop-down
list, then once either of the employers is selected, their address

shows
up
on the next line. I made an attempt at an 'if' statement, but it was

way
too
long and the formula bar wouldn't accept it. I want to do this to

avoid
having to use two different forms depending on which employer they

work
for.
Select employer, auto complete the address for them...easy. Or is it??
LOL!!
I have no idea when it comes to programming, and it seems anything I

knew
about macros has also been lost soemwhere along my journey from school

to
being almost 40





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
auto copy text in word to another text field in word earljones New Users 14 April 9th 08 12:04 AM
How do you turn off auto update of date field Gaberielle Gehring New Users 1 April 13th 06 05:22 PM
Auto update field problem VuKC Microsoft Word Help 1 November 23rd 05 12:49 AM
Auto fill a form field Pamela Microsoft Word Help 1 April 8th 05 07:42 PM
Auto Jump Text Field to Text Field jhnbernhard Tables 1 November 17th 04 02:13 PM


All times are GMT +1. The time now is 04:53 AM.

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"