Hi Peter,
A table would be good - just keep in mind these tables will need to be
"related" in order for this to work.
I would like to ask you to complete these steps using the Microsoft Access
Northwind sample database - this way you can see this work properly and
then migrate this to your application.
1) Create a new, blank InfoPath form
2) Add a drop-down list to the form named: ddlSuppliers
3) Add a drop-down list to the form named: ddlProducts
4) Add a new "Receive" data connection (Tools->Data Connections) to the
Northwind database using the Suppliers table. (Note: you will only need the
SupplierID and CompanyName fields.)
5) Add a new "Receive" data connection (Tools->Data Connections) to the
Northwind database using the Products table. (Note: you will only need the
ProductID, ProductName and SupplierID fields.)
6) Right-click on ddlSuppliers and choose Properties
7) On the Data tab select the option "Look up values in a data connection
to a database..." under the section "List Box Entries"
8) Set the Data Connection to Suppliers
9) Click the button next to the Entries box, highlight "d:Suppliers" and
click OK
10) Leave the Value field as: @SupplierID
11) Click the button next to Display name, highlight CompanyName and click
OK
12) Click OK to close the Properties window
13) Right-click on ddlProducts and choose Properties
14) On the Data tab select the option "Look up values in a data connection
to a database..." under the section "List Box Entries"
15) Set the Data Connection to Products
** NOTE: These next steps are important for the filtering! **
16) Click the button next to the Entries box, highlight "d
roducts" and
click the Filter Data button
17) Click Add
18) In the first box, select SupplierID
19) In the second box, select "Is Equal To"
20) In the third box, choose Select a Field or Group
21) From the Data Source box choose Main
22) Highlight ddlSuppliers and click OK
23) Click OK three times to get back to the Properties window
24) Leave the Value field as: @ProductID
25) Click the button next to Display name, highlight ProductName and click
OK
26) Click OK to get back to your form
** NOTE: These next steps are important for clearing out the previous
entries in ddlProducts once a new selection is made from ddlSuppliers! **
27) Right-click on ddlSuppliers and choose Properties
28) Click the Rules button
29) Click Add
30) Click Add Action
31) From the Action box choose Set a field's value
32) Click the button next to Field, select ddlProducts and click OK
33) Leave the Value field blank
34) Click OK four times to get back to your form
35) Preview your form and make a selection from ddlSuppliers - you should
only see a few items in the Products list.
36) Make a different selection from ddlSuppliers - you should now have a
different list of Products!
I hope this helps!
Best Regards,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.