Auto populate a field?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 :)
 
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(Company).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
 
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!! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top