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 / General MS InfoPath Questions / November 2005

Tip: Looking for answers? Try searching our database.

Filtering on Secondary Sources

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
stevebuy@eircom.net - 11 Nov 2005 12:20 GMT
Hopefully someone can help me with my problem.
I'll use the Northwind Database as an example.

I'm using the Supplier joined to the Products table as my Main Source.
In the Query Section, I want to select from a dropdown of all available
Suppliers so I have added a secondary Suppliers data source.
I then want to select from a dropdown of all Products associated with
that supplier. So I added a secondary Products data source
Thats where I run into problems.

My first dropdown has a rule that runs the secondary data source query.
This unfortunately return all products.
I cant seem to filter the products secondary datasource using the
chosen info in the suppliers secondary datasource.

Any help would me much appreciated.

SteveB.
Franck Dauché - 11 Nov 2005 15:17 GMT
Hi Steve,

Why don't you use code to filter:
string qry = "MyValue";
ADOAdapterObject oNameTable = (ADOAdapterObject)
thisXDocument.DataAdapters["tblTest"];
oNameTable.Command = string.Format("Select * from tblTest where Test = '" +
qry + "'");
oNameTable.Query();

Regards,

Franck Dauché

> Hopefully someone can help me with my problem.
> I'll use the Northwind Database as an example.
[quoted text clipped - 14 lines]
>
> SteveB.
S.Y.M. Wong-A-Ton - 13 Nov 2005 12:19 GMT
Hi SteveB,

To filter the products secondary datasource using the chosen info in the
suppliers secondary datasource, do the following:

Assuming you've already set the data source for the products dropdown:
- Double-click on the dropdown showing the products to open its properties
window
- Click on the "Select XPath" button behind the "Entries:" textbox
- In the "Select a Field or Group" dialog box, click on [Filter Data...]
- In the "Filter Data" dialog box, click on [Add...]
- Select the field referencing the supplier ID in the first dropdown
- Leave "is equal to" select in the second dropdown
- Select "Select a field or group..." in the third dropdown
- In the "Select a Field or Group" dialog box, select the "Main" data source
from the data source dropdown
- Click on the field representing the dropdown for the suppliers on your
InfoPath form
- Click on [OK] to close all dialog boxes except the last one showing the
properties for the products dropdown
- You will see that the values you had previously set for "Value" and
"Display name" have been reset. Set them again to the desired fields from the
secondary data source for products

The above should show only those products corresponding to the selected
supplier in the first dropdown.

Hope this helps. If you are still having problems getting it to work, let me
know.

Cheers,
S.Y.M. Wong-A-Ton

> Hopefully someone can help me with my problem.
> I'll use the Northwind Database as an example.
[quoted text clipped - 14 lines]
>
> SteveB.
 
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.