in

InfoPath Dev

Dreaded Cascading List boxes

Last post 06-11-2007 02:27 PM by hugs4thetrees. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-05-2007 02:40 PM

    Dreaded Cascading List boxes

    I've viewed all of the posts concerning cascading list boxes and I understand what is being suggested but I'm SO new to InfoPath I'm getting something wrong.  I'm populating my 2 list boxes from an Access Database.

     User selects a Category (i.e. List Bill, Enrollment, EOI etc...) and Items are filtered out in the second list box....  (i.e. user selects List Bill in first box and second box shows only items that pertain to List Bill auditing).  This works like a charm.  The problem is that it's a repeating table and when I insert a new row the data entered into the first row carries over.  I've seen repeatedly to use the Current() function but I've put it in every location imaginable to no success.  Might be because I have a Main table with a table nested under it and I need to reference the dfs stuff but don't know how to properly do it.

    Data sources look like this:

    My fields

       Queryfields

       Data Fields

         d:tblMainAuditInfo

             tblSAAudit (which contains the field "Category" that I am using in the 2nd list box).

    I'm setting the filter on my second list box as follows:

    Data connection = tblSAAuditItems (secondary data source)

    Entries = d:tblSAAuditItems

    Filter Data: 

    Category (a secondary data source tblSAAuditItems) is equal to xdxDocument:get-DOM()/dfs:myfields/dfs:datafields/d:tblMainAuditInfo/d:tblSAAudit/@Category 

    This works perfectly on a non-repeating table but where in the world do I put current() in to make it work for a repeating table? 

    I don't know if I've provided too much information or not enough....  this has to be easier than I'm making it!!

    Help is greatly appreciated!!  Thanks in advance! 

     

  • 06-06-2007 03:58 AM In reply to

    Re: Dreaded Cascading List boxes

    Hi,

    You need to make this XPath:

    xdxDocument:get-DOM()/dfs:myfields/dfs:datafields/d:tblMainAuditInfo/d:tblSAAudit/@Category 

    Be this:

    current()/d:tblSAAudit/@Category 

    If that doesn't work, try this:

    current()/../d:tblSAAudit/@Category 

     Hope this helps!

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-06-2007 05:45 AM In reply to

    Re: Dreaded Cascading List boxes

     First of all...  Thanks for the quick reply!!

     current()/../d:tblSAAudit/@Category gets the cascading drop downs working again but when I hit "insert item" on the repeating table, my selections from the first row still carry through to the next and if I change them in one row they change in all rows.  ??

  • 06-06-2007 10:04 AM In reply to

    Re: Dreaded Cascading List boxes

    I just realized that it's not just the cascading drop downs.  The whole record repeats itself.  It will add a new record to the table but if I change the selections in each new record, it changes all of the records to the same thing...  do I have to do the current() on ALL the fields in the Repeating table?

     Thanks!

  • 06-06-2007 12:14 PM In reply to

    Re: Dreaded Cascading List boxes

    When all else fails start over.  It's working now.  Thanks!
  • 06-08-2007 07:37 AM In reply to

    Re: Dreaded Cascading List boxes

    I spoke too soon.  The record is no longer completely repeating itself and my drop downs are working using current()/../d:tblSAAudit/@category BUT, when I move to the second record, the selections from the first record are included in the list.  I've again, seen postings to resolve this but they aren't working. 

    I tried /dfs:myfields/dfs:datafields/d:tblSAAudit[@category=current()/my:category] but the second drop down didn't work at all then....  what in the world am I missing here?  What exactly is my:category referring to?  I might be having some confusion because I'm pulling from 2 different sources but the fields are the same name.  The first text box pulls from a query (qryListSACategory) and the second list box pulls from the table that the query is based on (tblSAAuditItems) and stores the result in tblSAAudit in a field called "Description".

     So, essentially I need for drop down called "Description" to look at drop down called "Category" and pull only those descriptions for the category selected in the first drop down.  The selection in the second drop down is stored in the field called Description in tblSAAudit.  Works fine for the first record but the next repeated record is compounding the second drop down box results with those of the first record....

    What in the world am I missing?

  • 06-11-2007 12:08 PM In reply to

    Re: Dreaded Cascading List boxes

    You guys must have given up on me!!  But Im going to try a little more clarification:

    I have a Main data source that looks like this:

    myfields
    -datafields
    --d:tblMainAuditInfo
    ---field1 (insignificant)
    ---field2 (insignificant)
    ---etc (insignigicant)
    -----tblSAAudit (repeating) linked to tblMainAuditInfo by insignificant key field
    -------Category
    -------Description

    I have a secondary data source that looks like this:

    myfields
    -datafields
    --d:tblSAAuditItems
    ----Category
    ----Description.

    I have 2 list boxes in a repeating section.  First list box is for Category and pulls info from the Secondary data source.  Second list box is for Description and also pulls from the Secondary DS but I'm trying to filter it to only show descriptions within the category selected.  Category is working just fine and I even got the Unique value filter to work but I cannot get the second list box to show anything. 

    In the filter I'm doing as follows:
    1st box I'm selecting the field from tblSAAuditItems called Category
    2nd box "is equal to"
    3rd box "/../tblSAAuditItems[@Category=current()/my:Category]

    ...but nothing happens.  I'm not sure if I should be selecting Category from the main ds or the secondary ds in the 1st filter box and I'm not sure if I've got the 3rd one right either but I'm not getting any errors.  Just nothing at all! 

    Any additional help would be greatly appreciated.

  • 06-11-2007 02:27 PM In reply to

    Re: Dreaded Cascading List boxes

    HALLELUAH!  Finally working.  Changed one of my Category fields to CategoryName.  Apparently these formulas don't like items named the same thing in 2 different tables.

     CategoryName=Current()/@Category worked.

     

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