Autopopulate a text box from another by matching fields in a secondary data source? - InfoPath Dev
in

InfoPath Dev

Autopopulate a text box from another by matching fields in a secondary data source?

Last post 07-19-2007 01:26 AM by jorobertson. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-18-2007 08:36 AM

    Autopopulate a text box from another by matching fields in a secondary data source?

    Hi there,

    Sorry about the less-than-clear subject line, but I'm not sure how to describe this in a few words!

    My problem is I currently have a drop-down list (linked to an Access database) with several hundred options in it and users are complaining about the time it takes scrolling down the whole list. The secondary data source (the access db) simply consists of 2 fields in each record; the first a cost centre (e.g. 12345) and the second, a descriptor (e.g. "Finance Cost Centre").

    So my questions are these:

    - Is it possible to have a text box where users type their cost centre (e.g. 12345) and have it match this to the database and autopopulate another text box with the description e.g. Finance Cost Centre?? I can do this using cascading drop-down lists but want to avoid these for the reasons stated above. I suppose I need cascading text boxes.

    - Also, if the above is possible, is there any way to validate the cost centre entered so that an incorrect entry, when it doesn't match the underlying database, would output an error message?

    I should add I'm using Infopath 2003 SP2.

    Sorry if this is obvious but I'm new to all this! Many thanks in advance of any help you might be able to offer.

    Jo

  • 07-18-2007 11:19 AM In reply to

    Re: Autopopulate a text box from another by matching fields in a secondary data source?

    yes this is doable.

    You would have a text box for the cost center description entry.

    You would have a second field for the cost center number.  It would default to your secondary data connection cost center field with a filter of description = cost center description (what the user entered).  This should check to update automatically by default.  Then create a rule on the cost center number field which says if Cost center number is blank or does not = cost center in the data connection then pop a message or you can block submit if it is not valid.

    You can also use a conatins or begins with for your comparison of the description so that users do not have to type the whole thing.

    Another option would be cascading drop downs.

    User selects finance and then second dropdown has all of the sub locations for finance.

     

  • 07-19-2007 01:26 AM In reply to

    Re: Autopopulate a text box from another by matching fields in a secondary data source?

    Thanks for your help Clay. Actually my users are putting in the cost centre number and need the description to pop up (so round the other way) but I've got the autopopulate part working.

    The thing i'm stuck on now is the error message. I've added a rule on the cost centre text box saying if cost centre (entered into form) does not = cost centre (data connection) to pop up an error message. However, the error message pops up every time, even when I know the cost centres are valid (because they're bringing up the right description in the other box. Can anyone advise what I'm doing wrong??

    Thanks,

    Jo

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