Populating problems using Access database - InfoPath Dev
in

InfoPath Dev

Populating problems using Access database

Last post 09-15-2006 12:19 PM by cobbtrains. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-23-2006 02:13 PM

    Populating problems using Access database

    I had this problem before in your forum; however, the solution given me didn't work. Do you have any other thoughts or did I misinterpreted your solution?

    I have a dropdown list of records that looks up an Access database. I used rules to automatically populate my fields within the repeating table once the record is selected . I created a filter in the repeating table. My filter is as follows:
    Box 1 Box 2 Box 3 Box 4
    Name_Text_Box is equal to Assigned_To_List_Box Or
    Assigned_To_List_Box contains Show All

    When I select the record I want, it only populates fields with the last Access record. How can I force it to populate with the record I want? I should tell you at no time will a user add data to the Access database.
  • 08-25-2006 10:30 AM In reply to

    Re: Populating problems using Access database

    You need to use the current() function... check out the following articles and example forms:

    http://www.infopathdev.com/search.aspx?s=current()
  • 08-29-2006 10:51 AM In reply to

    Re: Populating problems using Access database

    quote:
    Originally posted by Greg Collins

    You need to use the current() function... check out the following articles and example forms:

    http://www.infopathdev.com/search.aspx?s=current()



    Thanks for responding.

    I spent a good portion of my time going throught these tutorials, workarounds, and examples. I only found one article that pertains to my problem, "Automatically Populate Fields from a Drop-Down Selection".

    I am using the rule functions since I do not know any codes. I set up rules in my drop-down box, the individual fields, and both. Where do I set-up my rules? I get the same results no matter how I set my rules. The rule I'm using is this, InfoPath_field=Access_field[@Access_record=current()].

    I have use the repeating section and the non-repeating section. I get the same results everytime.

    I have to use the company's .adp Access format. The field characters are nvarchar and text. The record is the only integer field. Is this still feasible to automatically populate my fields?
  • 08-30-2006 01:15 PM In reply to

    Re: Populating problems using Access database

    Rules are run when a field value changes. Only the rules on the field that changes are run. Thus your rules should be placed on the field that you expect to change.

    Access_field[@Access_record=current()] will only provide a value if Access_field itself contains a value... otherwise you will need something more like Access_field[@Access_record=current()]/Field_With_Value

    The correct XPath to use will depend entirely on the data source you have and where exactly current() points to.
  • 09-05-2006 11:49 AM In reply to

    Re: Populating problems using Access database

    quote:
    Originally posted by Greg Collins

    Rules are run when a field value changes. Only the rules on the field that changes are run. Thus your rules should be placed on the field that you expect to change.

    Access_field[@Access_record=current()] will only provide a value if Access_field itself contains a value... otherwise you will need something more like Access_field[@Access_record=current()]/Field_With_Value

    The correct XPath to use will depend entirely on the data source you have and where exactly current() points to.



    When I modified my rules to "otherwise you will need something more like Access_field[@Access_record=current()]/Field_With_Value", I get NaN when I run InfoPath. Am I missing something? My fields will not provide a value. I know that my Xpath is pointing to the right data source; however, when I force it to give me the record number I want, it gives me the last record. What am I doing wrong?
  • 09-05-2006 02:44 PM In reply to

    Re: Populating problems using Access database

    Are you positive that current() is pointing to a value that should match with @Access_record, and that it shouldn't perhaps be something more like 'current()/@attribute' or 'current()/Element' or something?
  • 09-15-2006 12:19 PM In reply to

    Re: Populating problems using Access database

    quote:
    Originally posted by Greg Collins

    Are you positive that current() is pointing to a value that should match with @Access_record, and that it shouldn't perhaps be something more like 'current()/@attribute' or 'current()/Element' or something?


    I thought I had the pointer pointing right but I don't. As an experiment, in preview mode, I selected the record I want in the drop down, I expected the record to be given back to me when I asked for it. It still gave me the last record. I put in the rule that it will be record[current()]. Now that I think about it, itsn't the current() going to give you the last record. Can I force it to give the record that I chose?
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.