many to many relationship - InfoPath Dev
in

InfoPath Dev

many to many relationship

Last post 08-15-2006 08:20 PM by Shiraz Cupala. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-10-2006 01:48 PM

    many to many relationship

    I have a form where I am entering records that are related to eachother. The best way I can think of to explain it would be to view it like a family tree.

    The form essentially has 2 fields, Name and a description, in my case, the Name of a person is also the unique identifyer.

    Person A Description Person A
    Person B Description Person B
    Person... Description Person ...

    Now, when you enter the information in for Person A, there is a repeating section to input the name of anyone related to Person A.

    What I would like to do is have another field in the repeating section for the related persons description. I.E. youre entering in Person C's name and description, then you go to the repeating section to add relationships. When you type in Person A in field 1, Person A's description shows up in field 2.

    So the record would look like this

    Table1 Record1: Person A Description Person A

    Table1 Record2: Person B Description Person B

    Table1 Record3:Person C Description Person C
    Table2 Record1:Person A Description Person A
    Table2 Record2:Person B Description Person B

    I've tried using a rule and filtering, but it just pulls the description from the parent field instead of checking all records.

    Looks like this:

    Table1 Record3:Person C Description Person C
    Table2 Record1:Person A Description Person C
    Table2 Record2:Person B Description Person C

    What I need for is the filter to look through the entire parent table instead of just the one record in the parent table associated with the child table.

    I hope this makes sense and thanks in advance for any help.
  • 08-10-2006 02:14 PM In reply to

    Re: many to many relationship

    In this case what you need to do is to populate the relation's description via a lookup. To do this you write a rule on the relation name field that fires to populate the relation's description based on the value in the relation name field. In the value field you need to go to the formula dialog, select the top level name field, then click the filter button to filter the entry where the value is equal to current(). To enter that you have to select "use a formula" for the right hand portion of the condition.

    Whew. So what you have done is essentially a lookup. The result is very simple, but to do through UI takes a lot of dialogs. :)
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 08-15-2006 08:37 AM In reply to

    Re: many to many relationship

    i tried doing it that way, didnt have much success. But then I realized, instead of essentially doing a lookup, why dont I really do a lookup. So I created a secondary connection from the main table, and populated the text box through the secondary connection. Thanks for the help, and thanks for making me aware of that ingenius current() function. It has really helped me overcome a few obstacles that were making me wonder if we had outgrown InfoPath's usefulness.

    Also, at some point nearing this forms completion, I would like to post it somewhere so that you may see what we have done. I personally think it is impressive.
  • 08-15-2006 08:20 PM In reply to

    Re: many to many relationship

    You're welcome. We'd love to see the form. You can email it to me separately. I'll send you a note.
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.