Login|Contact Us
Question and Answer

Ask a Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

Ask a Microsoft Word Question I am making a form with conditonal

 
Greg Maxey's Avatar
  • Answered by:Greg Maxey
  • Consultant\Microsoft Word Expert
  • Positive Feedback: 100.0 %
  • Accepted Answers: 31
Verified Expert
in General

Recent Feedback

Positive
I went to the website you recommended and was able to do all suggested there...
Positive
Great Job. Thank You.
Positive
Needed something more permanent. Can really use what was offered.
Positive
Thank you - you have solved the problem. In my mind this is a glitch/flaw in MS...
Positive
Fast response and spot on solution. Strong the force with this one is.
Positive
Amazing answer...thanks...will save me a lot of time as I do this kind of thing...
Positive
The answer was great and provided exactly what I needed, BUT unfortunately I...
Positive
Quick response and Greg went into the necessary detail needed to answer my...
Positive
Very helpful and patient.
Positive
Greg -- Because of the limitation in MS Word, I will probablly use Adobe...

Customer Question

Ask a Microsoft Word Question
>I am making a form with conditonal drop down fields. I know I can make a drop down field conditional on another one. However, I need to make two or three different drop down fields conditional on a single other field. is this possible?
Thanks,
Jeff

 



Already Tried:
I've played around with the VBE program shown at this website. http://vbaexpress.com/kb/getarticle.php?kb_id=5

Submitted: 785 days and 15 hours ago.
Category: General
Value: $23
Status: CLOSED
Picture
Expert:  Greg Maxey replied 785 days and 15 hours ago.

Yes it is possible. The below link shows you how to make a DD bookmarked "DDSecondary" dependent on a selection in another dropdown bookmarkd "DDPrimary"

 

All you would need to do is create the additional dropdown objects e.g.:

 

Dim oDDim oDD As DropDown
Set oDD2 = ActiveDocument.FormFields(AnnotherDD).DropDown

and then add the necessary lines of code in the Case statements.

Customer replied 784 days and 18 hours ago.

Greg,

 

Thanks for the quick response. I think I understand, but I am not a programmer. I've tried a couple times to modify my form per your instructions. So far it sort of works (I can get options to show up on the second conditional field, but they are not the correct options) but I still have problems. I suspect it is just coding errors on my part. Let me see if i can figure out what I may still be doing wrong. If I can get it to work correctly, I'll accept your answer by tomorrow. If not, I may need some additional guidance.

 

Jeff

Customer replied 784 days and 16 hours ago.

Greg,

 

I still have a minor problem. I can get everything to work if my two conditional fields have the same number of options. For instance, given the first field is dropdown1, I can get the fields identified as dropdown2 and dropdown3 to both work if they each have 14 entries. If dropdown2 has 14 entries and dropdown3 has 7 entries, I can't seem to program them properly.

 

Here is an excerpt of my programming for this step:

Case 1 ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries.Clear ActiveDocument.FormFields("Dropdown3").DropDown.ListEntries.Clear For var = 1 To 14 ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries.Add Name:=DefenceDD2(i) ActiveDocument.FormFields("Dropdown3").DropDown.ListEntries.Add Name:=DefenceDD3(i) i = i + 1 Next ActiveDocument.FormFields("Dropdown2").DropDown.Value = 1

ActiveDocument.FormFields("Dropdown3").DropDown.Value = 1

Case 2

 

In this case, DefenceDD2 is a list of 14 entries. DefenceDD3 is a list of 7 entries. I get error messages. I can put seven blank lines in DefenceDD3, but that just doesn't seem to be the proper way to do it.

 

If you can mark up this excerpt to show me how to program it properly, I would appreciate it. If that is beyond the scope of your answer, I understand. You have given me enough that I can make it work, even if my programming sucks.

 

Thanks,

 

Jeff

Accepted Answer

Picture
Expert:  Greg Maxey replied 784 days and 14 hours ago.

Well you didn't explain what DefenceDD2 or DefenceDD3 are but I assume they are arrays containing the list values. You are getting the error because you are trying obtain data that is out of scope.

 

Try this:

Sub DD1OnExit()
Dim var As Long
Dim aDefDD2() As String
Dim aDefDD3() As String
aDefDD2 = Split("A1,A2,A3,A4,A5,A6,A7,A8,A(,A10,A11,A12,A13,A14", ",")
aDefDD3 = Split("Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,Golf", ",")
Select Case ActiveDocument.FormFields("DropDown1").DropDown.Value
Case 1
ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries.Clear
ActiveDocument.FormFields("Dropdown3").DropDown.ListEntries.Clear
For var = 0 To 13
ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries.Add Name:=aDefDD2(var)
On Error Resume Next
ActiveDocument.FormFields("Dropdown3").DropDown.ListEntries.Add Name:=aDefDD3(var)
On Error GoTo 0
Next var
'Or do it like this:
ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries.Clear
ActiveDocument.FormFields("Dropdown3").DropDown.ListEntries.Clear
For var = 0 To UBound(aDefDD2)
ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries.Add Name:=aDefDD2(var)
Next var
For var = 0 To UBound(aDefDD3)
ActiveDocument.FormFields("Dropdown3").DropDown.ListEntries.Add Name:=aDefDD3(var)
Next var
ActiveDocument.FormFields("Dropdown2").DropDown.Value = 1
ActiveDocument.FormFields("Dropdown3").DropDown.Value = 1
Case 2
End Select
End Sub

Expert TypeConsultant\Microsoft Word Expert
Category: General
Pos. Feedback: 100.0 %
Accepts: 31
Answered: 3/23/2011

Experience: Microsoft Word Most Valuable Professional (6 years)

Ask this Expert a Question >
 
Tweet

153 Experts are Online Right Now

Ask Your Question Now
General Questions Date Submitted
How Can I Insert My Maiden Name, My Old Class Mates Are Not 5/6/2013
I am looking for someone to help me with this assignment. 5/2/2013
1. A(n) __________ is a personal representative named by the 5/1/2013
1) Big Fizz Co., a manufacturer of cola-flavored drinks, wants 4/30/2013
Many organizations have been in the news over the past few 4/29/2013
vintage toys and hobbies I need someone who knows vintage Trains. 4/29/2013
general partner contributions to a limited partnership 4/29/2013
The United States generally taxes U.S. source fixed and determinable, 4/26/2013
Which of the following is not one of the Complete Auto Transit's 4/26/2013
I have a general electrical dryer and i want to change it to 4/23/2013
RSS
Next 10 >
Ask an Expert
Type Your Question Here...
characters left:

Top General Experts

See More Experts

In The News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More
close
Find Expert answers related to your question.
Sign up using email
We will never post anything without your permission.
Already have an account? Sign in

Ask an Expert

Get a Professional Answer. 100% Satisfaction Guaranteed.
153 Experts are Online Now
Type Your Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us | Our Network
© 2003-2013 JustAnswer LLC
  • Pearl.com
  • JustAnswer UK
  • JustAnswer Germany
  • JustAnswer Spanish
  • JustAnswer Japan