<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>JP Software Technologies</title>
	
	<link>http://www.jpsoftwaretech.com</link>
	<description>Custom Office Programming and Automation</description>
	<lastBuildDate>Sat, 11 May 2013 11:13:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CodeForExcelAndOutlook" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="codeforexcelandoutlook" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /><image><link>http://www.jpsoftwaretech.com/</link><url>http://img.jpsoftwaretech.com/xo.png</url><title>Logo</title></image><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">CodeForExcelAndOutlook</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>ADODB Code to Trim Text Fields</title>
		<link>http://www.jpsoftwaretech.com/adodb-code-to-trim-text-fields/</link>
		<comments>http://www.jpsoftwaretech.com/adodb-code-to-trim-text-fields/#comments</comments>
		<pubDate>Sat, 20 Apr 2013 11:00:44 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Access]]></category>
		<category><![CDATA[ADODB]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://www.jpsoftwaretech.com/?p=2502</guid>
		<description><![CDATA[<p>In Trim all text fields in MS Access database I posted a method for removing excess spaces from a field in Access. This is a guest post from Dave Braunschweig showing how to do the same using ADODB. I needed an ADODB version of this and came up with the attached. Please share. Please visit<br /><span class="morelink"><a class="more-link" href="http://www.jpsoftwaretech.com/adodb-code-to-trim-text-fields/">Continue Reading &#187;</a></span></p><p><a href="http://www.jpsoftwaretech.com/adodb-code-to-trim-text-fields/">ADODB Code to Trim Text Fields</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p>]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://www.jpsoftwaretech.com/trim-text-fields-ms-access/">Trim all text fields in MS Access database</a> I posted a method for removing excess spaces from a field in Access. This is a guest post from Dave Braunschweig showing how to do the same using ADODB.<br />
<span id="more-2502"></span></p>
<p>I needed an ADODB version of this and came up with the attached.  Please share.</p>
<pre class="brush: vb; title: Code:; notranslate">Sub GetTables()
    Dim Recordset As ADODB.Recordset
    Dim TableName As String

    Set Recordset = CurrentProject.Connection.OpenSchema(adSchemaTables)

    Do While Not Recordset.EOF
        If Recordset(&quot;TABLE_TYPE&quot;) = &quot;TABLE&quot; Then
            TableName = Recordset(&quot;TABLE_NAME&quot;)
            GetColumns TableName
        End If
        Recordset.MoveNext
    Loop
    Recordset.Close
End Sub

Private Sub GetColumns(TableName As String)
    Dim Recordset As ADODB.Recordset
    Dim ColumnName As String
    
    Set Recordset = CurrentProject.Connection.OpenSchema(adSchemaColumns, Array(Null, Null, TableName))
    Do While Not Recordset.EOF
        If Recordset(&quot;DATA_TYPE&quot;) = 130 Then
            ColumnName = Recordset(&quot;COLUMN_NAME&quot;)
            UpdateColumn TableName, ColumnName
        End If
        Recordset.MoveNext
    Loop
    Recordset.Close
End Sub

Private Sub UpdateColumn(TableName As String, ColumnName As String)
    Dim Recordset As ADODB.Recordset
    
    Debug.Print TableName, ColumnName
    DoEvents
    Set Recordset = New ADODB.Recordset
    Recordset.Open TableName, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
    Do While Not Recordset.EOF
        If Not IsNull(Recordset(ColumnName)) Then
            Recordset(ColumnName) = Trim(Recordset(ColumnName))
        End If
        Recordset.MoveNext
    Loop
    Recordset.Close
End Sub</pre>
<p>Please visit <a href="http://www.jpsoftwaretech.com/contribute/">Contribute</a> if you would like to see a code sample posted here.</p>
<p><a href="http://www.jpsoftwaretech.com/adodb-code-to-trim-text-fields/">ADODB Code to Trim Text Fields</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=jIqs6Rq2IHY:sWsrcoX1xgU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=jIqs6Rq2IHY:sWsrcoX1xgU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=jIqs6Rq2IHY:sWsrcoX1xgU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=jIqs6Rq2IHY:sWsrcoX1xgU:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=jIqs6Rq2IHY:sWsrcoX1xgU:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=jIqs6Rq2IHY:sWsrcoX1xgU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=jIqs6Rq2IHY:sWsrcoX1xgU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=jIqs6Rq2IHY:sWsrcoX1xgU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=jIqs6Rq2IHY:sWsrcoX1xgU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=jIqs6Rq2IHY:sWsrcoX1xgU:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CodeForExcelAndOutlook/~4/jIqs6Rq2IHY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Data Generator 3.3.0 now available</title>
		<link>http://www.jpsoftwaretech.com/random-data-generator-3-3-0-now-available/</link>
		<comments>http://www.jpsoftwaretech.com/random-data-generator-3-3-0-now-available/#comments</comments>
		<pubDate>Fri, 22 Feb 2013 12:00:42 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[AddIns]]></category>
		<category><![CDATA[RDG]]></category>

		<guid isPermaLink="false">http://www.jpsoftwaretech.com/?p=2495</guid>
		<description><![CDATA[<p>Random Data Generator has been updated to version 3.3.0. To purchase, visit the RDG homepage. This version features several enhancements, including transient custom lists new fields additional field values primitive RegEx pattern masking options such as save location and quantity may be stored across sessions API has been enhanced</p><p><a href="http://www.jpsoftwaretech.com/random-data-generator-3-3-0-now-available/">Random Data Generator 3.3.0 now available</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p>]]></description>
				<content:encoded><![CDATA[<p>Random Data Generator has been updated to version 3.3.0. To purchase, visit the <a href="http://www.randomdatagenerator.net/">RDG homepage</a>.<br />
<span id="more-2495"></span><br />
This version features several enhancements, including</p>
<ul>
<li>transient custom lists</li>
<li>new fields</li>
<li>additional field values</li>
<li>primitive RegEx pattern masking</li>
<li>options such as save location and quantity may be stored across sessions</li>
<li>API has been enhanced</li>
</ul>
<p><img src="http://img.randomdatagenerator.net/RDG_v33.png" alt="random data generator" title="random data generator" width="536" height="476" /></p>
<a class="button-facebook" href="http://www.randomdatagenerator.net/" rel="nofollow">Learn more</a>
<p><a href="http://www.jpsoftwaretech.com/random-data-generator-3-3-0-now-available/">Random Data Generator 3.3.0 now available</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=NLHPjj_QHE4:QjyOlmRu9hw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=NLHPjj_QHE4:QjyOlmRu9hw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=NLHPjj_QHE4:QjyOlmRu9hw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=NLHPjj_QHE4:QjyOlmRu9hw:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=NLHPjj_QHE4:QjyOlmRu9hw:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=NLHPjj_QHE4:QjyOlmRu9hw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=NLHPjj_QHE4:QjyOlmRu9hw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=NLHPjj_QHE4:QjyOlmRu9hw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=NLHPjj_QHE4:QjyOlmRu9hw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=NLHPjj_QHE4:QjyOlmRu9hw:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CodeForExcelAndOutlook/~4/NLHPjj_QHE4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ShipTrack 4.2.5 now available</title>
		<link>http://www.jpsoftwaretech.com/shiptrack-4-2-5-now-available/</link>
		<comments>http://www.jpsoftwaretech.com/shiptrack-4-2-5-now-available/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 12:00:22 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[AddIns]]></category>
		<category><![CDATA[addin]]></category>
		<category><![CDATA[ShipTrack]]></category>

		<guid isPermaLink="false">http://www.jpsoftwaretech.com/?p=2485</guid>
		<description><![CDATA[<p>For those of you interested in tracking packages in Excel, ShipTrack 4.2.5 has just been released. DHL support has been (re-)added, as well as a few other novelties. Visit the download page to grab it and the About page to read more.</p><p><a href="http://www.jpsoftwaretech.com/shiptrack-4-2-5-now-available/">ShipTrack 4.2.5 now available</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p>]]></description>
				<content:encoded><![CDATA[<p>For those of you interested in tracking packages in Excel, ShipTrack 4.2.5 has just been released. DHL support has been (re-)added, as well as a few other novelties. Visit the <a href="http://www.shiptrackaddin.com/download/">download page</a> to grab it and the <a href="http://www.shiptrackaddin.com/about/">About</a> page to read more.</p>
<p><a href="http://www.jpsoftwaretech.com/shiptrack-4-2-5-now-available/">ShipTrack 4.2.5 now available</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=zLGS-A7uVfY:Ixm-Li5KW9k:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=zLGS-A7uVfY:Ixm-Li5KW9k:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=zLGS-A7uVfY:Ixm-Li5KW9k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=zLGS-A7uVfY:Ixm-Li5KW9k:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=zLGS-A7uVfY:Ixm-Li5KW9k:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=zLGS-A7uVfY:Ixm-Li5KW9k:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=zLGS-A7uVfY:Ixm-Li5KW9k:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=zLGS-A7uVfY:Ixm-Li5KW9k:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=zLGS-A7uVfY:Ixm-Li5KW9k:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=zLGS-A7uVfY:Ixm-Li5KW9k:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CodeForExcelAndOutlook/~4/zLGS-A7uVfY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2013 State of the Blog</title>
		<link>http://www.jpsoftwaretech.com/2013-state-of-the-blog/</link>
		<comments>http://www.jpsoftwaretech.com/2013-state-of-the-blog/#comments</comments>
		<pubDate>Mon, 28 Jan 2013 12:00:02 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Administrative]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.jpsoftwaretech.com/?p=2483</guid>
		<description><![CDATA[<p>Greetings! It has been a while since I last posted, so I thought I'd provide a short update on what has been happening lately with the site. I haven't spent much time writing VBA. Between the holidays, family and work, there simply isn't time to sit down and write a proper blog post. I did,<br /><span class="morelink"><a class="more-link" href="http://www.jpsoftwaretech.com/2013-state-of-the-blog/">Continue Reading &#187;</a></span></p><p><a href="http://www.jpsoftwaretech.com/2013-state-of-the-blog/">2013 State of the Blog</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p>]]></description>
				<content:encoded><![CDATA[<p>Greetings!</p>
<p>It has been a while since I last posted, so I thought I'd provide a short update on what has been happening lately with the site.</p>
<p>I haven't spent much time writing VBA. Between the holidays, family and work, there simply isn't time to sit down and write a proper blog post.</p>
<p>I did, however, launch a new website on New Year's Eve because I have been spending more time writing PHP. Click <a href="http://www.jimmyscode.com/">here</a> if you want to check it out. So far I have two WordPress plugins and four MyBB plugins written, with one more of each pending.</p>
<h3>2012 Stats</h3>
<p>Last year this site had 250,000 visits from 200,000 people. After getting close to 2,000 hits per day, my site was spanked by Google's algorithm update, so now we get around 800. I didn't think I write like a robot but apparently Google thinks differently. I should probably order a <a href="https://yoast.com/hire-us/website-review/">website review</a> to figure out what I'm doing wrong.</p>
<h3>Most popular referrers</h3>
<p>These sites provided the most visits in 2012:</p>
<ul>
<li><a href="http://www.stackoverflow.com/">Stack Overflow</a></li>
<li><a href="http://www.mrexcel.com/">MrExcel</a></li>
<li><a href="http://social.msdn.microsoft.com/">MSDN</a></li>
<li><a href="http://www.vbaexpress.com/">VBAX</a></li>
<li><a href="http://chandoo.org/">Chandoo</a></li>
<li><a href="http://www.dailydoseofexcel.com/">DDoE</a></li>
<li><a href="http://www.planetaexcel.ru/">Planet Excel</a></li>
<li><a href="http://www.programmableweb.com/">Programmable Web</a></li>
<li><a href="http://www.excelforum.com/">Excel Forum</a></li>
<li><a href="http://www.datapigtechnologies.com/">DataPig</a></li>
<li><a href="http://p2p.wrox.com/">Wrox</a></li>
<li><a href="http://spreadsheetpage.com/">Spreadsheet Page</a></li>
<li><a href="http://www.access-programmers.co.uk/">Access World</a></li>
<li><a href="http://blog.contextures.com/">Contextures Blog</a></li>
<li><a href="http://office.microsoft.com/">Office</a></li>
<li><a href="http://www.ozgrid.com/">OzGrid</a></li>
</ul>
<p>Thank you to everyone who felt compelled to link to this site!</p>
<h3>Downloads</h3>
<p>The mail merge tutorial continues to be the most popular download. Visit the <a href="http://www.jpsoftwaretech.com/downloads/">Downloads</a> page for a full listing.</p>
<h3>Addins</h3>
<p>Updates to <a href="http://www.shiptrackaddin.com/">ShipTrack</a> and <a href="http://www.randomdatagenerator.net/">RDG</a> are in progress. ShipTrack has become more popular and several new carriers have been added. A few more enhancements are pending.</p>
<p>I will continue to post to this blog as time permits. There are still a few more posts in the "Useful Array Functions for VBA" series that I have yet to complete.</p>
<p><a href="http://www.jpsoftwaretech.com/2013-state-of-the-blog/">2013 State of the Blog</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=nudqzZUq9o0:K2ZPDHR4_Us:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=nudqzZUq9o0:K2ZPDHR4_Us:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=nudqzZUq9o0:K2ZPDHR4_Us:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=nudqzZUq9o0:K2ZPDHR4_Us:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=nudqzZUq9o0:K2ZPDHR4_Us:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=nudqzZUq9o0:K2ZPDHR4_Us:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=nudqzZUq9o0:K2ZPDHR4_Us:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=nudqzZUq9o0:K2ZPDHR4_Us:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=nudqzZUq9o0:K2ZPDHR4_Us:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=nudqzZUq9o0:K2ZPDHR4_Us:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CodeForExcelAndOutlook/~4/nudqzZUq9o0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updated code to trim all text fields in a MS Access database</title>
		<link>http://www.jpsoftwaretech.com/updated-code-trim-text-fields-ms-access/</link>
		<comments>http://www.jpsoftwaretech.com/updated-code-trim-text-fields-ms-access/#comments</comments>
		<pubDate>Tue, 11 Dec 2012 12:00:49 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Access]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://www.jpsoftwaretech.com/?p=2474</guid>
		<description><![CDATA[<p>This is a guest post from Eric @ http://ventre-a-pattes.net/. I loved your TrimAllTextFieldsAllTables [Editors note: See original post], but it fails if some tables have no text fields. Attached is a slightly modified version that fixes the issue. Thanks again. Thank you Eric! My code was intended to be run on tables that have all<br /><span class="morelink"><a class="more-link" href="http://www.jpsoftwaretech.com/updated-code-trim-text-fields-ms-access/">Continue Reading &#187;</a></span></p><p><a href="http://www.jpsoftwaretech.com/updated-code-trim-text-fields-ms-access/">Updated code to trim all text fields in a MS Access database</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p>]]></description>
				<content:encoded><![CDATA[<p>This is a guest post from Eric @ <a href="http://ventre-a-pattes.net/">http://ventre-a-pattes.net/</a>.</p>
<p>I loved your TrimAllTextFieldsAllTables [Editors note: See <a href="http://www.jpsoftwaretech.com/trim-text-fields-ms-access/">original post</a>], but it fails if some tables have no text fields. Attached is a slightly modified version that fixes the issue.</p>
<p>Thanks again.<br />
<span id="more-2474"></span></p>
<pre class="brush: vb; title: Code:; notranslate">Sub TrimAllTextFieldsAllTables()
  Dim db As DAO.Database
  Dim tbls As DAO.TableDefs
  Dim tbl As DAO.TableDef
  Dim thisTable As DAO.TableDef
  Dim SQLString As String
  Dim flds As DAO.Fields
  Dim fld As DAO.Field
  Dim hasText As Boolean
 
  Set db = CurrentDb
  Set tbls = db.TableDefs
 
  ' loop through each appropriate table (i.e. no linked or system tables)
  For Each tbl In tbls
    hasText = False 'added
    If tbl.Attributes = 0 Then
      Set thisTable = tbl
      ' grab all fields
      Set flds = thisTable.Fields
 
      SQLString = &quot;UPDATE [&quot; &amp; tbl.Name &amp; &quot;] SET &quot;
 
      ' if field is text, create SQL string to trim it
      For Each fld In flds
        If fld.Type = dbText Then
          hasText = True 'added
          SQLString = SQLString &amp; _
                 &quot;[&quot; &amp; fld.Name &amp; &quot;] = Trim([&quot; &amp; fld.Name &amp; &quot;]),&quot;
        End If
      Next fld
 
      SQLString = Left(SQLString, Len(SQLString) - 1) &amp; &quot;;&quot;
      If hasText Then 'added
        Debug.Print SQLString
        ' execute update statement on table
        db.Execute SQLString, dbFailOnError
      End If 'added
    End If
  Next tbl
 
End Sub</pre>
<p>Thank you Eric! My code was intended to be run on tables that have all text fields, but this code can be run on tables with a mix of text and numeric fields.</p>
<p>If you would like to contribute a code sample, visit the <a href="http://www.jpsoftwaretech.com/contribute/">Contribute</a> page.</p>
<p><a href="http://www.jpsoftwaretech.com/updated-code-trim-text-fields-ms-access/">Updated code to trim all text fields in a MS Access database</a> is Copyright © <a href="http://www.jpsoftwaretech.com">JP Software Technologies</a>. All Rights Reserved.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=kjMaBMKGKyY:eZBDW4z9-Kk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=kjMaBMKGKyY:eZBDW4z9-Kk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=kjMaBMKGKyY:eZBDW4z9-Kk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=kjMaBMKGKyY:eZBDW4z9-Kk:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=kjMaBMKGKyY:eZBDW4z9-Kk:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=kjMaBMKGKyY:eZBDW4z9-Kk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=kjMaBMKGKyY:eZBDW4z9-Kk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=kjMaBMKGKyY:eZBDW4z9-Kk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?a=kjMaBMKGKyY:eZBDW4z9-Kk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CodeForExcelAndOutlook?i=kjMaBMKGKyY:eZBDW4z9-Kk:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CodeForExcelAndOutlook/~4/kjMaBMKGKyY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
