Lookup from access db returns same value (in repeating section) - InfoPath Dev
in

InfoPath Dev

Lookup from access db returns same value (in repeating section)

Last post 09-08-2010 08:44 AM by Robert Hansen. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 10-01-2009 01:35 PM

    Lookup from access db returns same value (in repeating section)

    I have a REPEATING SECTION, that contains a text field with rules for looking up values from an Access database.

    The value that the user enters could be 3 ,4 or 5 characters in length. First I translate the value so it is upper case, then I test the length...if 3 characters I concatenate 2 spaces, or 1 space if its a length of 4. Now, here is the issue....the first value entered is fine, the lookup works normally if its has a length of 4. If I add another group to be looked up in the (REPEATING SECTION), with a length of 5, the value the lookup returns is the same as the value from the first lookup. If I keep entering into the lookup, it returns the same value over and over....

    Do I need to clear it out, and how would i do it....thanks hope this is understandable.

  • 10-03-2009 05:54 AM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    Hi, Ed:

    Your rule is set on your text field in your repeating section? What's the rule look like? It sounds like the data isn't being filtered properly to select the correct value from the Access data source, if you are always getting the first row returned. I take it the values in the Access DB that you are comparing your form info to are uppercase and fixed width (5 chars)?

    Hilary Stoupa

  • 10-05-2009 09:29 AM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    Hi Hilary,

    The rule is as follows....Rule 1. Checks for Custom Pattern of 3 characters concat(., "  ") adds 2 spaces to the field.

                                      Rule 2. Checks for custom pattern of 4 characters and if so, concats 1 space to the field

                                      Rule 3. Checks for custom pattern of 5, then translates the value to upper case.

                                      The next rule does the actual lookup...    Existing_Grp_Name = @RELM[ @RELM_ID = Existing_Grp_ID]

     

     In a regular text field this works fine, but in this case, its in a repeating section, so no matter what I enter in the text box, the same GROUP NAME is returned by the rule. Thanks for your help.

  • 10-05-2009 11:49 AM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    What field is the rule on? Is it a field INSIDE the repeating group? Or outside?

    Hilary Stoupa

  • 10-05-2009 11:58 AM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    The field is INSIDE the repeating group....

  • 10-05-2009 01:58 PM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    Is the rule on the field that you are modifying? What field is the rule on, and what field are you setting the value for? What field is being changed by the rules that add spaces and modify to upper case? Maybe you could attach a copy of your template (under the Options tab when you post)?

    Hilary Stoupa

  • 10-06-2009 09:34 AM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    I have attached a copy of the form. Where it says click here to create a new nom PL Group.. under the SELF MANAGED part. The field GROUP NUMBER contains the rules and the GROUP NAME is whre the value from the lookup rules will be displayed. Everything is done in the GROUP NUMBER FIELD.....It is simply to provide the GROUP NAME so the NAME will be correct.

  • 10-06-2009 10:55 AM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    It looks like your rule to set the value is before your rules that add spaces if the field is too short. Do you add the spaces to get the Existing_group_number to match the DB's @RELMID? If so, those rules need to run before the rule where you try to set the existing_group_name. Also, I believe Rule 5 needs to use current() instead of the full XPath to the Existing_group_number field -- Please see the attached template for these changes.

    Hilary Stoupa

  • 10-06-2009 12:18 PM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    Hi Hilary,

    I can't thank you enough, the form works like a charm. The current() -- yes, that makes sense to me now. By the way, is there a decent Infopath book where I can find tidbits like that? Again, thank you very much for your help. 

     

  • 10-06-2009 12:45 PM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    Since you are still using IP 2003, I'd recommend Patrick Halstead's book: Developing Solutions with Microsoft InfoPath

    Hilary Stoupa

  • 09-08-2010 08:44 AM In reply to

    Re: Lookup from access db returns same value (in repeating section)

    Hello, I am new to this forum, and found this issue which is almost the same as what I am experiencing.

    I am using a repeating table, and am setting a dollar value to a "balance" field, when an account number I have just entered matches an account number in an Access DB. 

    The difference in my results (from that of the original posting) is that sometimes I automatically get correct dollar amounts for each new row I enter in the table (each row having a unique account number) and sometimes the dollar amount will keep retrieving and displaying the value obtained in the previous row. 

    I have a rule set up on a text field immediately preceding the field where I display this retrieved dollar amount.  This rule contains a filter for an account number comparison that I obtained from one of Hilary Stoupa's earlier posts.  That post pertained to a user always getting the FIRST value of her database under circumstances slightly similar to mine.

    There must be some aspect of repeating tables that I am not understanding.   Can anyone help?  I realize I have probably not provided enough information here. 

    I am using no custom code at all - just Infopath 2003 functionality.

    Thanks very much in advance!

    Bob Hansen 

     

     

     

     

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