Creating a form..drop-down should populate other fields

H

HT

Microsoft Word 2003
WindowsXP

I am creating a form that has a drop-down menu. The drop-down menu has a
list of names. I want to be able to choose the drop-down menu name and have
the fields that ask for the phone number and work hours to automatically
populate once you choose the person's name.

For instance: John Smith works 9:00-5:00 and his phone number is
(555)555-5555.

I want to be able to choose John Smith and have the phone number, works
hours immediately input in the fields.

If I ever get this part done I want to be able to click on a button and have
all of the text copy to the clipboard and paste into the body of an e-mail.

Thanks all!
 
G

Greg

Very similiar question asked and answered a few days ago:

You can't just select the name. You have to select the name then exit
the field with a macro set to run on exit from that field. Something
like:

Sub Fillin()
Dim oDoc As Document
Set oDoc = ActiveDocument
Select Case oDoc.FormFields("DropDown1").R­esult
Case Is = "Sheila"
oDoc.FormFields("Text1").Resul­t = "321-1234"
oDoc.FormFields("Text2").Resul­t = "(e-mail address removed)"
Case Is = "Greg"
oDoc.FormFields("Text1").Resul­t = "987-6754"
oDoc.FormFields("Text2").Resul­t = "(e-mail address removed)"
Case Else
oDoc.FormFields("Text1").Resul­t = "???-????"
oDoc.FormFields("Text2").Resul­t = "[email protected]"
End Select
End Sub
 
H

HT

Sorry for the redundancy Greg..I usually don't pay attention to form
questions because I don't usually use them.

It seems too complicated..not a macro person.

Thanks again!

Very similiar question asked and answered a few days ago:

You can't just select the name. You have to select the name then exit
the field with a macro set to run on exit from that field. Something
like:

Sub Fillin()
Dim oDoc As Document
Set oDoc = ActiveDocument
Select Case oDoc.FormFields("DropDown1").R­esult
Case Is = "Sheila"
oDoc.FormFields("Text1").Resul­t = "321-1234"
oDoc.FormFields("Text2").Resul­t = "(e-mail address removed)"
Case Is = "Greg"
oDoc.FormFields("Text1").Resul­t = "987-6754"
oDoc.FormFields("Text2").Resul­t = "(e-mail address removed)"
Case Else
oDoc.FormFields("Text1").Resul­t = "???-????"
oDoc.FormFields("Text2").Resul­t = "[email protected]"
End Select
End Sub
 
C

Charles Kenyon

Instead of a macro, you could have a number of IF fields set to test the
results of your drop-down. The drop down must be set to calculate on exit,
and you do have to exit.
{ IF ddList1 = "Sam" "555-1212" }{ IF ddList1 = "Bill" "555-2121" } and so
forth. Each IF field tests the results of your drop down and upon the proper
result displays what you want.

Maintenance on this could be a real nightmare. Hope it helps.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
H

HT

Thanks Charles..what if I created a bookmark type of something (like my
jibberish)..typed it in one field and had that same field populate the other
fields. I am trying to simplify the procedure should someone else need to
pick up after it is completed..I'm afraid the macros may not carry over to
every user.
 
H

HT

Haha..ok so I have to go the macro route??

I'm practicing now..I printed out all the e-mails, the tutorials on "What do
I do with macros sent to me by other newsgroup readers to help me out".

If you saw my desk right now....
 
C

Charles Kenyon

From the FAQ

19. How can I enter something once in a document and have it repeat
elsewhere?
http://gregmaxey.mvps.org/Repeating_Data.htm


Items in formfields are automatically bookmarked with the name of the field.
In my example, I assumed that the field name was ddList1.

Problems with inserted bookmarks instead of formfields include:

1) They are very fragile. It is difficult type in one without deleting the
bookmark.
2) After you update the bookmark contents, you have to update the REF field.
This is taken care of in a protected form if you mark the source field to
"calculate on exit."
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
H

HT

Charles,

Thank you..my attempt at macro-writing was horrible..I believe the Repeating
Data is the key that I need..will update the results.
 

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

Top