Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Auto select drop down value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bryan - 22 Nov 2007 15:59 GMT
On document.new, I am pre-loading fields with info from our host system.
I need to auto select a drop down value based on a value in text1.

For example let's say the drop down list contains
WNA
WNI
PMI

if text1 = '1' then I want to auto select WNI in the drop down

Thanks in advance,
Bryan
Graham Mayor - 24 Nov 2007 14:11 GMT
You would need something like

Sub OnExitText1()
Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
Select Case oFld("Text1").Result
 Case Is = "1"
   oFld("DropDown1").Result = "WNA"
 Case Is = "2"
   oFld("DropDown1").Result = "WNI"
 Case Is = "3"
   oFld("DropDown1").Result = "PMI"
 Case Else
   'Do nothing
End Select
End Sub

with a case statement for each value of Dropdown1 that you wish to load

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> On document.new, I am pre-loading fields with info from our host
> system. I need to auto select a drop down value based on a value in
[quoted text clipped - 9 lines]
> Thanks in advance,
> Bryan

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.