Re: How do I auto populate a field based off of my list selection



Thank you Doug.

This is a great start for me and you've provided wonderful direction :)

I was actually hoping for a response like this one so that I can educate
myself on VBA, user forms, etc. I had been searching high and low and didn't
know where to start.

Thanks again,
Julie


"Doug Robbins - Word MVP" wrote:

If you create an autotext entry containing each email address with that
autotext entry having the corresponding name that would be in the list from
which you want the users to pick (actually assumed to be a DropDown type
FormField as you say that you are going to protect the document, you could
use the following code in a macro that is run on exit from the DropDown
FormField:

' 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(Company).Value

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



End Sub

I would suggest however that you consider the use of a user form, but you
will have a bit of learning to do. In the first instance, you should
probably work your way through the following articles

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


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

"Julie" <Julie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6D768DAC-B243-4D4E-B318-86DF916EA435@xxxxxxxxxxxxxxxx
OK, here it goes :)

I dont know anything about VBA and I'm thinking I will need to learn to do
what I want to do in my .doc.

I have a table of 'contact info' in my document which I'm going to lock so
that it will be used as a template for others (where they can only update
certain fields and select information that I've provided).

I have two lists now in .doc but it's messy...l:
Name Email address

Currently if I pick the name, then I have to go to the Email address list
and pick the corresponding email address.

What I want to have happen is if I pick a Name on the left, the Email
address will autopopulate in the list by itself.

One step further, and even better:
To not even have an email address 'list', but have word just insert the
email address in the cell to the right of "Name"...I just don't know how
to
create the list of values for it to populate based off of the selection in
the list.

Again, I don't know VBA here so please be clear :)))

Thank you for any help,
Julie




.



Relevant Pages

  • Re: Creating, Populating and Linking combo boxes Word 2K
    ... Private Sub Document_New ... In the VBA ... When it comes to setting the "secondary" lists, ... graphics and controls as desired. ...
    (microsoft.public.word.vba.general)
  • Re: Creating, Populating and Linking combo boxes Word 2K
    ... Private Sub Document_New ... In the VBA ... graphics and controls as desired. ... I also want to place some VBA controls (specifically, drop down lists ...
    (microsoft.public.word.vba.general)
  • RE: Object Browser does what?
    ... As for the object browser it can be quite useful but it takes a bit of ... > got the error, I looked up Range in VBA help, but it doesn't list ... > I've also been very confused when the Object Browser lists multiple ... Why tell me twice that range is a child of Worksheet? ...
    (microsoft.public.excel.programming)
  • Re: Need learning materials for Access
    ... There are many resources available. ... best: these newsgroups! ... Access 2000 VBA, by Sussman and Smith was one I found helpful in beginning ... > I want to learn more about making selections from lists or combo boxes. ...
    (microsoft.public.access.formscoding)
  • Re: Tom Ogilvys VBA code
    ... I got hold of a vba code by Myrna Larson (July 25, 2000, ... Enter this in cell A2 ... which is pending in this code is that it also lists duplicates which I ... remove the conditional formatting in the range AC11:AL11 the total time ...
    (microsoft.public.excel.programming)