Two linked drop-down list boxes

M

Marc

I wonder who could help me with this?

I've got two drop-down list box and I would like that the value selected in
the first one determines the values chosen in the second one. Could anyone
give me the details on how to do it plus the code?

Thank you,

Marc
 
B

Ben Walters

Hey Marc
You can acutally do this directly in InfoPath without any code.
Set your first Drop Down box to retrieve the list of values you want then in
your second Drop down box when you select the field to display you can also
set a filter for the data that is being displayed. As long as the data source
your using for DD2 has a relationship of some type to the data that is
selected in DD1 you can filter the values that are selected e.g.


DD1 Data source
------------
Authors
------------
John Smith
Jane Smith
Maryanne Ellis

DD2 Data source
------------ -------------------
Authors Books
------------ --------------------
John Smith Spots First Walk
John Smith Spots Second Walk
Jane Smith 101 things to do with Meat
Jane Smith Cooking For Dummies
Maryanne Ellis The idiots gude to Drinking Cofee

so when you map DD1 to the first Data source you set it's display value to
be Authors

When you map DD2 to the second data source you set it's display value to be
Books but with a filter that says when Authors = DD1.DisplayValue

If you need more info let me know and I'll throw a blog post up with some
screen shots

Cheers
Ben
 
M

mgraye

i am also interested in this. i want the equivalent of an IF-ELSE function
in excel. i have two drop down lists next to each other on the same row. if
you select an item in the first box it automatically selects an item in the
second box. could you explain how to do this or does each drop box selection
have to made separately, which i already have set up.
 
M

Marc

Thank you Ben for your help. I see what you mean but I've been trying
unsuccessfully to do it. This is why I wonder if you could give me some more
details or send me a sample file (this would be the best option). My email
address is (e-mail address removed)

Because mgraye is also interested if he or she sends me a message to this
address I will transfer the sample file. I reckon this would allow us to
understand how it works.

Thank you very much again and I hope ti hear from you again either in the
newsgroup or at my address.

All the best,

marc
 
D

Denniso6

Hi Ben...,

If you have time, I'd also appreciate a sample of the .xsn as well.

Please send to (e-mail address removed).

thanks so much in advance.

D
----------
 

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