Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Alyssa
 
Posts: n/a
Default Use the IF, THEN statement in Word

For example, I want a statement that tells me this:
If (dropdown box1) equals (A), then I want 2 options yielded, if (dropdown
box1)equals (B), then I want 2 different options yielded, etc.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey
 
Posts: n/a
Default Use the IF, THEN statement in Word

You will need to run a macro something like the following on exit from your
first dropdown field.

Sub SwapOptions()
Dim oFFld As FormFields
Dim i As Integer
Set oFFld = ActiveDocument.FormFields
Select Case oFFld("Dropdown1").Result
Case Is = "A"
For i = oFFld("Dropdown2").DropDown.ListEntries.Count To 1 Step -1
oFFld("Dropdown2").DropDown.ListEntries(i).Delete
Next
oFFld("Dropdown2").DropDown.ListEntries.Add "Apples"
oFFld("Dropdown2").DropDown.ListEntries.Add "Appricots"
Case Is = "B"
For i = oFFld("Dropdown2").DropDown.ListEntries.Count To 1 Step -1
oFFld("Dropdown2").DropDown.ListEntries(i).Delete
Next
oFFld("Dropdown2").DropDown.ListEntries.Add "Blueberries"
oFFld("Dropdown2").DropDown.ListEntries.Add "Butterbeans"
Case Else
End Select
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

"Alyssa" wrote in message
...
For example, I want a statement that tells me this:
If (dropdown box1) equals (A), then I want 2 options yielded, if (dropdown
box1)equals (B), then I want 2 different options yielded, etc.



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
WP merge file to Word sstires Tables 4 February 14th 06 07:26 PM
How can Word display full path of a file in the title bar? SAsif Microsoft Word Help 1 January 26th 06 05:32 PM
Does Word have a QuickCorrect/Quick Word option like WordPerfect? CW New Users 2 December 20th 05 06:54 PM
In Word, how do I surpress headers and footers on page 2 Bill Microsoft Word Help 1 December 15th 05 07:13 PM
In Word, how can I see all files (*.*) in "save as"? citizen53 New Users 8 April 4th 05 04:56 PM


All times are GMT +1. The time now is 12:36 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"