﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Can not Get Loop to Work</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 11 Sep 2026 13:32:13 GMT</lastBuildDate><ttl>20</ttl><item><title>Can not Get Loop to Work</title><link>http://forum.strataframe.net/FindPost29620.aspx</link><description>What am I missing? I tried the following code:&lt;div&gt;&lt;br/&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'For Each lobo As ResultsPerfsChecksRoughStockBO In Me.ResultsPerfsChecksRoughStockBO1.GetEnumerable&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' &amp;nbsp; &amp;nbsp;cword = DecimalToText.ConvertDecimalToText(Me.ResultsPerfsChecksRoughStockBO1.netcheck)&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' &amp;nbsp; &amp;nbsp;Me.ResultsPerfsChecksRoughStockBO1.amountinwords = cword&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' &amp;nbsp; &amp;nbsp;y += 1&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Next&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Could Not Get the Above to Work because it would only do the &lt;strong&gt;First Record&lt;/strong&gt;. So I put the following in&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MessageBox.Show(Me.ResultsPerfsChecksRoughStockBO1.Sort)&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MessageBox.Show(Me.ResultsPerfsChecksRoughStockBO1.Filter)&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MessageBox.Show(Me.ResultsPerfsChecksRoughStockBO1.Count.ToString())&lt;br/&gt;&lt;br/&gt;&lt;div&gt;The First two messageboxes show nothing and the last one shows 10 which is correct. So I tried the following code and it only does the&lt;strong&gt; first record&lt;/strong&gt; also?????&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If Me.ResultsPerfsChecksRoughStockBO1.MoveFirst() Then&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Loop Thru All Records Making Sure NetCheck is Correct and Getting Words for Netcheck&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Do&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;nnet = Me.ResultsPerfsChecksRoughStockBO1.checkamt + Me.ResultsPerfsChecksRoughStockBO1.groundmoney - &amp;nbsp;Me.ResultsPerfsChecksRoughStockBO1.tax&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cword = DecimalToText.ConvertDecimalToText(Me.ResultsPerfsChecksRoughStockBO1.netcheck)&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.ResultsPerfsChecksRoughStockBO1.amountinwords = cword&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;nnet = 0.0&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Loop While Me.ResultsPerfsChecksRoughStockBO1.MoveNext()&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I just can not see the trees for the forest. I know it has to be something weird I am doing but I don't know what it is. Any help would be appreciated. TIA.</description><pubDate>Sun, 27 Feb 2011 06:43:00 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Can not Get Loop to Work</title><link>http://forum.strataframe.net/FindPost29624.aspx</link><description>Well an interesting thing happened. While trying to debug the above problem as Edhy recommended, since I have a DevExpress Grid on my form with a BBS I was just entering different values to see if I could find out why it did the first record and skipped all of the rest. Since I have such a few records I have always been entering data to the bottom of the grid. But this time I stopped entering about half way through the records, and in debugging I noticed it did the first record and skipped to the record that I left it on in the grid???????? &amp;nbsp;I was floored. I still have no clue as to why that happens since I even reloaded my BO because I could not get the loop to work?&amp;nbsp;&lt;div&gt;But I put this statement in my code before the loop and it now seems to work great.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Me.GridView1.MoveFirst()&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I'm sure this might be logical but it seems strange to me since I did reload my BO.?&lt;div&gt;TIA.</description><pubDate>Sun, 27 Feb 2011 06:43:00 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Can not Get Loop to Work</title><link>http://forum.strataframe.net/FindPost29623.aspx</link><description>Hi Terry,&lt;br/&gt;Ivan's code is the correct way to handle the BO.GetEnumerable().&lt;br/&gt;In your code I assume that the cword has been previously defined, but it is not really needed you can do it in a single line of code&lt;br/&gt;&lt;span&gt;[code]lobo.amountinwords =  DecimalToText.ConvertDecimalToText(lobo.netcheck)[/code]&lt;/span&gt;&lt;span id="ctl00_ctlContentPlaceHolder_ctl00_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl02_lblFullMessage"&gt;&lt;br/&gt;The only reason I have seen BO.GetEnumerable() going crazy is when you have a Sort or Filter and based on your original post those are cleared, so I suggest you debug the loop to see what may be happening.&lt;br/&gt;&lt;/span&gt;</description><pubDate>Sat, 26 Feb 2011 19:16:01 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Can not Get Loop to Work</title><link>http://forum.strataframe.net/FindPost29622.aspx</link><description>Sorry to say that did not work either????</description><pubDate>Sat, 26 Feb 2011 15:18:18 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Can not Get Loop to Work</title><link>http://forum.strataframe.net/FindPost29621.aspx</link><description>Hi Terry.&lt;br/&gt;&lt;br/&gt;Try this one:&lt;br/&gt;&lt;br/&gt;[codesnippet]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each lobo As ResultsPerfsChecksRoughStockBO In Me.ResultsPerfsChecksRoughStockBO1.GetEnumerable&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cword = DecimalToText.ConvertDecimalToText(lobo.netcheck)&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lobo.amountinwords = cword&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y += 1&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;br/&gt;[/codesnippet]&lt;br/&gt;&lt;br/&gt;Notice you are dealing with the &lt;strong&gt;lobo&lt;/strong&gt; instance created for the loop.</description><pubDate>Sat, 26 Feb 2011 10:35:38 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>