Displaying unique values in dropdown - InfoPath Dev
in

InfoPath Dev

Displaying unique values in dropdown

Last post 09-01-2006 01:29 AM by pcapsey. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-31-2006 07:49 AM

    • pcapsey
    • Not Ranked
    • Joined on 02-14-2006
    • Ireland
    • Posts 9

    Displaying unique values in dropdown

    Hi there,

    I have a problem regarding a filter on cascading dropdown boxes. The data to be displayed in the dropdown boxes are held on tables in an Access database.

    The relationship between the three dropdown boxes looks like this:

    Project --> Subproject --> Technical Product

    The Project and associated Subprojects are held on one table. The Technical Products are held on a separate table; the field that links the two tables is Subproject.

    When I select a Project from the Project dropdown, I see a list of associated Subprojects in the Subproject dropdown. When I select the Subproject I should see, in the Technical Products dropdown, a list of Technical Products associated with the Subproject. This is the filter, with which I#%92m having problems.

    A Technical Product can be associated with more than one Subproject, which seems to be causing the problem.

    Example data in the Technical Product table:

    Subproject ------ Technical Product
    EAB_EBA --------- CC_EBA
    EAB_EBA --------- WR_Tools
    EBA_FM ---------- CC_FM
    EBA_FM ---------- CC_SHM
    EBA_FM ---------- WR_Tools

    In the example above, the Technical Product dropdown displays both of the Technical Products when EAB_EBA is selected as the Subproject, BUT it only displays the first two Technical Products when EBA_FM is selected, ignoring WR_Tools.

    I have the following filters on the Technical Product dropdown:

    The expression not(. = ../preceding::d:TA_Products/@TA_L2) and
    QCP_Subproject = TA_Subproject

    where QCP_Subproject is the Subproject selected by the user, and TA_Subproject is the Subproject from the Technical Products table.

    If I remove the expression from the filter, the Technical Products dropdown displays multiple instances of all three Technical Products, which is what I would expect.

    I#%92ve noticed this problem with every Technical Product that is associated with more than one Subproject. The Technical Product is always displayed with the first Subproject in the list from the Projects table.

    I#%92d be grateful for any suggestions. I#%92ve tried sorting the Technical Products table by Subproject and Technical Product but to no avail. I#%92ve tried using a query run against the Technical Products table, sorted by the above two fields, again to no avail. I#%92ve also tried using preceding-sibling but that makes no difference.

    I've used filters before, and have worked through the various tutorials available on InfoPathDev, but nothing has helped so far!

    Thanks and regards,

    Pete
  • 08-31-2006 12:43 PM In reply to

    Re: Displaying unique values in dropdown

    Hey Pete,

    I think you need to refine the statment that filters non-unique entries. Try this filter out:

    not(. = ../preceding::d:TA_Products[QCP_Subproject = TA_Subproject]/@TA_L2) and
    QCP_Subproject = TA_Subproject

    I'm not exactly sure how your schema is laid out and it seems like you are using some psuedo-code to simplify the filter, but I think this should make sense. Do you see the mistake? You were looking at ALL of the preceding XML, but you should only be looking at the preceding XML that is relevant to what you are currently filtering.

    I hope this helps, let me know if there are any other questions!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-01-2006 01:29 AM In reply to

    • pcapsey
    • Not Ranked
    • Joined on 02-14-2006
    • Ireland
    • Posts 9

    Re: Displaying unique values in dropdown

    Hi Matt,

    Thanks for your quick response, but unfortunately it didn't work... When I use the filters you define, I get the same result as I do without the Preceding expression - a list of multiple instances of the three Technical Products.

    I'm not sure what you mean by using pseudo-code to simplify the filter. The filter is set up using the InfoPath feature, and I haven't changed the schema as I wouldn't know how!

    The idea behind the form is to enable the user to select records from or to create new records in the table QCP0_Table.

    The fields Project - Subproject - Technical Product are used to access the table QCP0_Table. They are all dropdown boxes on the form. Project and Subproject are populated from the table QCP_Project, a secondary data source. Technical Product is populated (and filtered!) from the table TA_Products, another secondary data source.

    I appreciate your help with this, as it is driving me mad!

    Thanks and regards,

    Pete
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.