<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Static ID # for Repeating Section, with ability to move the sections</title><link>https://www.infopathdev.com:443/forums/thread/43519.aspx</link><pubDate>Fri, 26 Jun 2009 19:20:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43519</guid><dc:creator>wiibur</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43519.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43519</wfw:commentRss><description>&lt;p&gt;What I am trying to do is have a repeating section that has an ID # assigned to it. The way it works now is that I have an ID field which is assigned a value from an ID Iterator field that is incremented each time a new section is added. Pretty standard.&lt;/p&gt;&lt;p&gt;&amp;nbsp;The next thing I added to this form was the ability to move each section using the following code and stuff. I have two buttons, one to move the section up and one to move it down. As you can see from the code, it just performs a simple insert after/before for moving. The problem is that each time the form re-inserts the section, it is assigned a new ID # because the form thinks it is a new section.&lt;/p&gt;&lt;p&gt;&amp;nbsp;What I need help with is how to keep the ID # static. Any help will be appreciated.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Up/Down button code (VBScript found from googling):&lt;/p&gt;Sub CTRL27_11_OnClick(eventObj)
	&lt;br /&gt;&lt;blockquote&gt;Dim oItem, oParent, oPrevious
	
	&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;Set oItem = eventObj.Source &lt;br /&gt;Set oParent = oItem.parentNode
	&lt;br /&gt;Set oPrevious = oItem.previousSibling
	
	&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;If Not (oPrevious Is Nothing) Then
		&lt;br /&gt;&lt;blockquote&gt;oParent.removeChild oItem
		&lt;br /&gt;oParent.insertBefore oItem, oPrevious
		
	&lt;br /&gt;&lt;/blockquote&gt;End If
&lt;br /&gt;&lt;/blockquote&gt;End Sub

&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks again. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>