Retreiving data from DB - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Retreiving data from DB

Last post 07-11-2006 09:06 AM by Carolyn. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-10-2006 06:20 AM

    • cgreeff
    • Not Ranked
    • Joined on 07-10-2006
    • Namibia
    • Posts 5

    Retreiving data from DB

    Hi guys

    Hope all is well. :-)

    The question I have might have been answered in some other forum, though I haven't seen anything that has. (I might not have looked properly)

    I'm relatively new to Infopath...

    Here's what I'm doing and have gotten right...

    I've got a form adding records into a database and that's all working well, etc (Access db) - did that with a ODBC called CONsubmit

    I then created a ODBC called CONretreive to obviously retreive records from my db and post them into a form. This is also all working fine....but....now....the question I have is....

    I got a field called ClientID and when I change this I want the rest of fields to change according to that client's information. So thus when my data is retreived from the db a user should be able to select all the relevant ClientID or ClientName from a drop-down list and then when selecting a client from that list all the other info should be displayed as well...How do I go about doing this?

    Any help would be appreciated or blogg I can go read...

    Thanks!!
  • 07-10-2006 10:27 AM In reply to

    Re: Retreiving data from DB

    quote:
    I got a field called ClientID and when I change this I want the rest of fields to change according to that client's information. So thus when my data is retreived from the db a user should be able to select all the relevant ClientID or ClientName from a drop-down list and then when selecting a client from that list all the other info should be displayed as well...How do I go about doing this?

    Make a rule on the field holding ClientID that when the value of that field changes, query the db.
  • 07-11-2006 02:43 AM In reply to

    • cgreeff
    • Not Ranked
    • Joined on 07-10-2006
    • Namibia
    • Posts 5

    Re: Retreiving data from DB

    Hi Carolyn

    Thanks for the swift reply.

    I understand what you mean, however I cannot get it working.

    I have a "repeating section with controls"
    ClientID
    ClientName
    ClientCode
    TaskCode
    ClientFax
    ClientTel
    etc etc etc

    When I preview the form data from the db is displayed auto. That's great....but now, after I applied a rule on the "Client Name" putting the action to "query the database" nothing happens when I put it another / Change the ClientName field?

    Am I missing a condition or should I put a rule on each field?
  • 07-11-2006 06:33 AM In reply to

    Re: Retreiving data from DB

    Have a look at the Data Source pane. You'll notice your Access db has two sets of fields: "q" and "d". That's Query and Data. You want to pull the Query Client ID into the form, then query off that. The data will then pop in.

    I'll tell you how I like to do it. I like to make the query field a drop-down so the user can choose from a pre-determined list. In the Access mdb I create a query that returns just (as you said) Client ID. Then, I make that a secondary data connection in the InfoPath form.

    I would drag over the Client ID query field, and change it from a text box to a drop-down list, then assign that dropdown list to have the secondary data connection as the data source.

    Next, drag over the "Data" detail records into a table or section. Finally, set it so that when the data changes in the dropdown control, the db is queried. Do that with a rule. Alternatively, you could make a "Go" button whose rule is to query the db.

    Now, the user opens the drop-down, finds the proper Client ID, that control changes, and the db is queried.

    If you have a lot of Client IDs, then a dropdown would not be appropriate. In that case, the user would just type it in, but you still have the principle that if that control (a text box) changes, then the db is queried.
  • 07-11-2006 08:43 AM In reply to

    • cgreeff
    • Not Ranked
    • Joined on 07-10-2006
    • Namibia
    • Posts 5

    Re: Retreiving data from DB

    Hi Carolyn

    Thanks! Got it working...

    Should've just used my logic in dragging in from the Query side and not the Data side.

    Thanks for the help. :-)

    Enjoy the rest of your day.
  • 07-11-2006 09:06 AM In reply to

    Re: Retreiving data from DB

    I'm glad it's working for you. It took me a while to get used to it, too.
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.