Need to choose record from database - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Need to choose record from database

Last post 10-06-2008 03:21 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-06-2008 06:46 AM

    Need to choose record from database

    I'm fairly new to IP, but I'm fumbling along.  I now have a question.

    An example of the 2 records I am trying to get from the db:

    Joe Smith

    123 Main Street

    Anytown, USA

    and

    Joe Smith

    789 Main Street

    Anytown, USA

    what I am trying to do is query the db to display only these two records to display when I type in a portion of the name.  ie Joe

    and then I need to select one of these records to display on the form.  And make the other one disappear.  (disappear on the form, not the database)

    Currently when I query the database I get all records listed.  I am using a repeating section.  I'm not sure if this is even the correct route.

  • 10-06-2008 11:34 AM In reply to

    Re: Need to choose record from database

    Hi johnmacd,

    While taking the data connection to Data base, after selecting the Data base you will find one button “Edit SQL” in Data connection Wizard. Click that button and edit the SQL as per your requirement, then test your SQL statement by clicking on ‘Test SQL Statement’ button.

    In this way you can select the records by using where condition in SQL statement.
  • 10-06-2008 12:37 PM In reply to

    Re: Need to choose record from database

    Thanks, but I dont know SQL.  Now I'm totally lost.

     

    One problem I'm having right now is when I use the "Run Query" button it returns all records in the database.  I'd like to be able to narrow down the results based off a partial name match.  And then I would like to be able to choose that one record.

  • 10-06-2008 03:21 PM In reply to

    Re: Need to choose record from database

    You have a few choices. One of them is changing your form's SQL query in code before running it to make it dynamic -- that is, to add a "Where" clause that includes the information typed in your text box. Another is to build or buy a web service. A third choice would be to go ahead and return all the rows when you run the query, but to conditionally format your table to only show the rows where (for example) the first name field begins with the value in your text box.

    To conditionally format your table, right click the table and select conditional formatting (I think if you are using IP2003, you have to go into the table properties). Add a new condition, and select the field from the table you wish to match on, then "begins with", then the text field you are filling out with the value to compare to.

    Hilary Stoupa

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