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 / February 2006

Tip: Looking for answers? Try searching our database.

Filter combo content

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anders - 14 Feb 2006 14:50 GMT
Hi all,

I really could use some some help now....:-|.

I have a form containing two combo boxes; Products and ProductRegion. I
populate them from two SharePoint Lists called the same.

The Products Region SharePoint list have one column; Region. The Products
SharePoint list have two columns; Product and Region. The Region column is a
lookup column pointing to Region in the ProductRegion list.

I would like both lists to be fully populated initially. When a user selects
a ProductRegion I would like to filter the Products combo to show only the
products in the selected region. I cannot get this to work...

I have started with finding out what values I am comparing. If I create a
rule in the Products combo to fill out a temporary textbox with the
ProductRegion of the selected Product from the data connection, it writes
<region_id>;#<region>. Example: 1;#Europe. The ProductRegion combo writes
only the <region> to the temporary textbox. Example: Europe. I can handle
this by using the function substring-after. substring-after(@Region[Product =
@Product]; "#") gives Europe as result.

Now, if I create a rule in the ProductRegion combo to Set Fields Value with
the condition that the Products field is to be populated with Products from
from the Products data connection filtered to take only the products with the
same region as selected in the ProductRegion combo.
@Product[ProductRegion = substring-after(@Region; ";")]

I have also tried to create a filter on the Products combo to select rows
only with the same ProductRegion as the one selected in the ProductsRegion
combo.
In the Products combo, in the column definition I have created a filter that
the ProductRegion combo should equal to the function substring-after(@Region;
";").
This results in that the Products combo becomes empty what ever I choose.

Clear as mud...clear as my brain right now....

I would really appreciate any help.
Anders
S.Y.M. Wong-A-Ton - 15 Feb 2006 11:58 GMT
I've created two data connections from XML files with the values from your
lists. By filling the products combo and filtering it on the value selected
in the region combo, the products combo successfully shows the products
corresponding to the selected region. I used the substring-after function
just like you did, and it worked.

So filtering the products combo when populating it should be enough, using a
filter like [ProductRegion = substring-after(@Region, "#")] where
ProductRegion is the region field in your Main data source and
substring-after(@Region, "#") the region for a product in your secondary data
source.

Note that both the expressions you are trying to use contain ";" instead of
","

substring-after(@Region; ";")  //<= wrong way of using substring-after

should be

substring-after(@Region, ";")  //<= see the comma used after @Region?

for the substring-after function to work.
---
S.Y.M. Wong-A-Ton

> Hi all,
>
[quoted text clipped - 37 lines]
> I would really appreciate any help.
> Anders
 
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.