<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6323.aspx</link><pubDate>Wed, 22 Dec 2004 09:42:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6323</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6323.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6323</wfw:commentRss><description>Thanks for sharing!  :)</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6322.aspx</link><pubDate>Tue, 21 Dec 2004 19:35:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6322</guid><dc:creator>crashoverride</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6322.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6322</wfw:commentRss><description>I created a group in the main data source with all the fields that my user would need for their input values. (The group looks much like the ones generated by the main data source because it has a repeating group under it with all the relevant fields) I then created a repeating table and binded it to the repeating group. I created a button that executes code when it is clicked in order to query and submit each line to the database. Here is the code behind the button (VBScript):&lt;br /&gt;&lt;br /&gt;Sub CTRL12_7_OnClick(eventObj)&lt;br /&gt;&lt;br /&gt;Dim queryString&lt;br /&gt;Dim MoneyBalance&lt;br /&gt;Dim objNodeList&lt;br /&gt;Dim objNodeList2&lt;br /&gt;Dim i&lt;br /&gt;&lt;br /&gt;'Below is a command that gets all the data from the repeating table in the form&lt;br /&gt;&lt;br /&gt;set objNodeList = XDocument.DOM.selectNodes("/dfs:myFields/my:group/my:repeatingGroup") &lt;br /&gt;&lt;br /&gt;'Below is a loop which goes through &lt;b&gt;each&lt;/b&gt; line in the repeating table and builds a query string based on the inputs, then queries it against the database to find the correct record to change, then changes the MoneyBal data field of that record, and then submits it back to the database&lt;br /&gt;&lt;br /&gt;for i=0 to (objNodeList.length - 1)&lt;br /&gt;MoneyBalance = objNodeList.Item(i).getAttribute("my:MoneyBal")&lt;br /&gt;&lt;br /&gt;queryString = "Select * from PortfolioTable where PortfolioID=" &lt;br /&gt;queryString = queryString + objNodeList.Item(i).getAttribute("my:PID") + " and RptYear='"&lt;br /&gt;queryString = queryString + objNodeList.Item(i).getAttribute("my:rptY") + "' and RptMonth='"&lt;br /&gt;queryString = queryString + objNodeList.Item(i).getAttribute("my:rptM") + "' and FundID="&lt;br /&gt;queryString = queryString + objNodeList.Item(i).getAttribute("my:fund")&lt;br /&gt;&lt;br /&gt;XDocument.QueryAdapter.Command = queryString&lt;br /&gt;XDocument.Query()&lt;br /&gt;&lt;br /&gt;'After the query is executed, there should only be one record in the data source, and this is the one that is changed and submitted back to the database &lt;br /&gt;&lt;br /&gt;set objNodeList2 = XDocument.DOM.selectNodes("/dfs:myFields/dfs:dataFields/d:PortfolioTable")&lt;br /&gt;objNodeList2.item(0).setAttribute "MoneyBal", MoneyBalance&lt;br /&gt;XDocument.Submit()&lt;br /&gt;&lt;br /&gt;next&lt;br /&gt;&lt;br /&gt;msgbox "The form was submitted"&lt;br /&gt;Application.XDocuments.Close(0)&lt;br /&gt;&lt;br /&gt;End Sub</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6321.aspx</link><pubDate>Tue, 21 Dec 2004 19:01:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6321</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6321.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6321</wfw:commentRss><description>Glad to hear it! Do you mind sharing your final solution?&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6320.aspx</link><pubDate>Tue, 21 Dec 2004 18:43:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6320</guid><dc:creator>crashoverride</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6320.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6320</wfw:commentRss><description>Problem solved.</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6319.aspx</link><pubDate>Mon, 20 Dec 2004 19:04:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6319</guid><dc:creator>crashoverride</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6319.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6319</wfw:commentRss><description>I created a seperate repeating table in the main data source (for user inputs) that is independent of the data fields. Can someone provide me with some help with the code on how to take the user inputs and submit them to the database?&lt;br /&gt;&lt;br /&gt;My best guess involves using a loop to capture each line in the repeating table. For each line, I will create a query string based on the inputs and then query and submit to the database using the lines&lt;br /&gt;&lt;br /&gt;XDocument.QueryAdapter.Command = myInputString&lt;br /&gt;XDocument.Query() &lt;br /&gt;XDocument.Submit()&lt;br /&gt;&lt;br /&gt;Does this seem reasonable or is there a better way?</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6318.aspx</link><pubDate>Thu, 18 Nov 2004 18:48:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6318</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6318.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6318</wfw:commentRss><description>When you can't do what you want with what InfoPath provides, its time to start looking at building your own stuff.&lt;br /&gt;&lt;br /&gt;Here's what I suggest:&lt;br /&gt;&lt;br /&gt;1. Create a secondary data source that will be your repeating table of {PortfolioID} {FundID} {RptMonth} {RptYear}.&lt;br /&gt;2. Use the repeating table bound to the secondary data source for the user to enter their query values.&lt;br /&gt;3. Use code on a "Query" button which will generate the SQL query statement by combining all of the table rows together into a valid SQL statement.&lt;br /&gt;4. Drop this built query string into the main data source query.&lt;br /&gt;5. Force the query to happen using code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6317.aspx</link><pubDate>Mon, 15 Nov 2004 22:17:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6317</guid><dc:creator>crashoverride</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6317.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6317</wfw:commentRss><description>Here is a clarification of what I am trying to do:&lt;br /&gt;&lt;br /&gt;I want a user to be able to enter data for any number of funds at once (i.e., in a tabular format so they dont have to reopen the form over and over to do the same thing for different funds):&lt;br /&gt;&lt;br /&gt;PortfolioID   FundID   RptMonth   RptYear   MoneyBalance&lt;br /&gt;1             1        Jan        2004      &amp;lt;edit this&amp;gt;&lt;br /&gt;1             2        Jan        2004      &amp;lt;edit this&amp;gt;&lt;br /&gt;1             6        Dec        2003      &amp;lt;edit this&amp;gt;&lt;br /&gt;etc&lt;br /&gt;&lt;br /&gt;In order to edit the MoneyBalance fields however, I need to first query the portfolioID, FundID, RptMonth, and ReportYear fields of each row.</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6316.aspx</link><pubDate>Mon, 15 Nov 2004 22:04:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6316</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6316.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6316</wfw:commentRss><description>Have you tried using a wildcard for the fund? If you want the user to be able to search across funds, then why not just build that into your query, either by the user typing a wildcard, or by using custom code to build your query before submitting it.&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6315.aspx</link><pubDate>Mon, 15 Nov 2004 21:47:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6315</guid><dc:creator>crashoverride</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6315.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6315</wfw:commentRss><description>Here is an example of what I am trying to do:&lt;br /&gt;&lt;br /&gt;I have a table in an Access database that has information about investments. The table lists the returns for different mutual funds in different portfolios at different times. The fields are FundID, PortfolioID, ReportMonth, ReportYear, ReturnPCT, and MoneyBalance. &lt;br /&gt;&lt;br /&gt;A user creates a record by entering the ReturnPCT for a given month and year for a given fund and portfolio. A user is able to create &lt;i&gt;multiple&lt;/i&gt; records for multiple funds &lt;i&gt;at one time &lt;/i&gt;through the use of a repeating table. This is done through a seperate form which I have working properly.&lt;br /&gt;&lt;br /&gt;My problem is that because of reporting timing, a user must enter the MoneyBalance for a fund a few weeks after the record has been created for a particular fund in a particular month and year. (i.e., when the user creates fund records via the other form, the MoneyBalance field is blank for a few weeks). Thus, a user must be able to query the database on FundID, PortfolioID, ReportMonth, and ReportYear to get the appropriate MoneyBalance field and then enter the correct figure. I want the user to be able to do this for multiple funds at once, just as they created multiple records at once. I want them to be able to make several queries at once, in essence a table of queries:&lt;br /&gt;&lt;br /&gt;PortfolioID(Q1)  FundID(Q1)  RptMonth(Q1) RptYear(Q1) MoneyBalance&lt;br /&gt;PortfolioID(Q2)  FundID(Q2)  RptMonth(Q2) RptYear(Q2) MoneyBalance&lt;br /&gt;PortfolioID(Q3)  FundID(Q3)  RptMonth(Q3) RptYear(Q3) MoneyBalance&lt;br /&gt;etc&lt;br /&gt;&lt;br /&gt;Any help would be much appreciated!!!&lt;br /&gt;</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6314.aspx</link><pubDate>Mon, 15 Nov 2004 18:42:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6314</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6314.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6314</wfw:commentRss><description>Maybe I'm not understanding what exactly you want to do.&lt;br /&gt;&lt;br /&gt;When you query, you query in a single set of fields. The query itself RETURNS multiple rows. Those returned rows are populated into the datafields. That is where you do your editing and submitting. The query is only to get the multiple rows into the datafields... not to do the editing itself.&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6313.aspx</link><pubDate>Mon, 15 Nov 2004 16:40:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6313</guid><dc:creator>crashoverride</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6313.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6313</wfw:commentRss><description>But I also need to query multiple records at once in order to make the changes to those multiple records...any idea how to do this?</description></item><item><title>Re: Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/6312.aspx</link><pubDate>Thu, 11 Nov 2004 18:40:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6312</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6312.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6312</wfw:commentRss><description>What you are experiencing is the correct behavior. The query fields are not for data editing and submission, that's what the data fields are for. The query fields are only to "query" the database and populate the data fields.&lt;br /&gt;&lt;br /&gt;You need to bind your repeating table to the data fields for data entry and submission.&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Repeating table and query fields problem</title><link>https://www.infopathdev.com:443/forums/thread/4498.aspx</link><pubDate>Wed, 03 Nov 2004 21:05:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4498</guid><dc:creator>crashoverride</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4498.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=4498</wfw:commentRss><description>I am having a problem because Infopath will not allow me to bind a repeating table to query fields.&lt;br /&gt;&lt;br /&gt;What I need to do is be able to edit and submit several rows of records in an Access database at one time from my infopath form.</description></item></channel></rss>