<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>ikapeng.com &#187; MS ACCESS</title>
	<atom:link href="http://www.ikapeng.com/category/knowledge/ms-access/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ikapeng.com</link>
	<description>:Knowledge,Entertain,Nonsensical,Sports,Download &#38; all Share at Here !!!</description>
	<lastBuildDate>Wed, 28 Jul 2010 09:33:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>แปลงตัวเลขเป็นตัวอักษร ใน MS ACCESS</title>
		<link>http://www.ikapeng.com/%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b9%80%e0%b8%a5%e0%b8%82%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b8%ad%e0%b8%b1%e0%b8%81%e0%b8%a9%e0%b8%a3-%e0%b9%83%e0%b8%99-ms-access.html</link>
		<comments>http://www.ikapeng.com/%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b9%80%e0%b8%a5%e0%b8%82%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b8%ad%e0%b8%b1%e0%b8%81%e0%b8%a9%e0%b8%a3-%e0%b9%83%e0%b8%99-ms-access.html#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:29:17 +0000</pubDate>
		<dc:creator>ikapeng</dc:creator>
				<category><![CDATA[MS ACCESS]]></category>
		<category><![CDATA[แปลงตัวเลขเป็นตัวอักษร]]></category>

		<guid isPermaLink="false">http://www.ikapeng.com/?p=59</guid>
		<description><![CDATA[เรามาลอง แปลงตัวเลขเป็นตัวอักษร ใน MS ACCESS กันคับ


Function &#60;span style=&#34;color: #ff0000;&#34;&#62;sBahtText&#60;/span&#62;(ByVal sNum)
Dim sNumber, sDigit, sDigit10
Dim nLen, sWord, sWord2
Dim sByte, I, J

sNumber = Array(&#34;&#34;, &#34;หนึ่ง&#34;, &#34;สอง&#34;, &#34;สาม&#34;, &#34;สี่&#34;, &#34;ห้า&#34;, &#34;หก&#34;, &#34;เจ็ด&#34;, &#34;แปด&#34;, &#34;เก้า&#34;)
sDigit = Array(&#34;&#34;, &#34;สิบ&#34;, &#34;ร้อย&#34;, &#34;พัน&#34;, &#34;หมื่น&#34;, &#34;แสน&#34;)
sDigit10 = Array(&#34;&#34;, &#34;สิบ&#34;, &#34;ยี่สิบ&#34;, &#34;สามสิบ&#34;, &#34;สี่สิบ&#34;, &#34;ห้าสิบ&#34;, &#34;หกสิบ&#34;, &#34;เจ็ดสิบ&#34;, &#34;แปดสิบ&#34;, &#34;เก้าสิบ&#34;)
sNum = Replace(FormatNumber(sNum, 2), &#34;,&#34;, &#34;&#34;)
nLen = Len(sNum)

If [...]]]></description>
			<content:encoded><![CDATA[<p>เรามาลอง แปลงตัวเลขเป็นตัวอักษร ใน MS ACCESS กันคับ</p>
<pre class="brush: vb; ">

Function &lt;span style=&quot;color: #ff0000;&quot;&gt;sBahtText&lt;/span&gt;(ByVal sNum)
Dim sNumber, sDigit, sDigit10
Dim nLen, sWord, sWord2
Dim sByte, I, J

sNumber = Array(&quot;&quot;, &quot;หนึ่ง&quot;, &quot;สอง&quot;, &quot;สาม&quot;, &quot;สี่&quot;, &quot;ห้า&quot;, &quot;หก&quot;, &quot;เจ็ด&quot;, &quot;แปด&quot;, &quot;เก้า&quot;)
sDigit = Array(&quot;&quot;, &quot;สิบ&quot;, &quot;ร้อย&quot;, &quot;พัน&quot;, &quot;หมื่น&quot;, &quot;แสน&quot;)
sDigit10 = Array(&quot;&quot;, &quot;สิบ&quot;, &quot;ยี่สิบ&quot;, &quot;สามสิบ&quot;, &quot;สี่สิบ&quot;, &quot;ห้าสิบ&quot;, &quot;หกสิบ&quot;, &quot;เจ็ดสิบ&quot;, &quot;แปดสิบ&quot;, &quot;เก้าสิบ&quot;)
sNum = Replace(FormatNumber(sNum, 2), &quot;,&quot;, &quot;&quot;)
nLen = Len(sNum)

If sNum = &quot;.00&quot; Then sBahtText = &quot;ศูนย์&quot;
For I = 1 To nLen - 3
J = (15 + nLen - I) Mod 6
sByte = Mid(sNum, I, 1)
If sByte &lt;&gt; &quot;0&quot; Then
If J = 1 Then sWord = sDigit10(sByte) Else sWord = sNumber(sByte) &amp; sDigit(J)
sBahtText = sBahtText &amp; sWord
End If
If J = 0 And I &lt;&gt; nLen - 3 Then sBahtText = sBahtText &amp; &quot;ล้าน&quot;: sBahtText = Replace(sBahtText, &quot;หนึ่งล้าน&quot;, &quot;เอ็ดล้าน&quot;)
Next
If Left(sNum, 1) = &quot;1&quot; Then sBahtText = Replace(sBahtText, &quot;เอ็ดล้าน&quot;, &quot;หนึ่งล้าน&quot;)
If Left(sNum, 2) = &quot;11&quot; Then sBahtText = Replace(sBahtText, &quot;สิบหนึ่งล้าน&quot;, &quot;สิบเอ็ดล้าน&quot;)
If Len(sBahtText) &gt; 0 Then sBahtText = sBahtText &amp; &quot;บาท&quot;
If nLen &gt; 4 Then sBahtText = Replace(sBahtText, &quot;หนึ่งบาท&quot;, &quot;เอ็ดบาท&quot;)
sNum = Right(sNum, 2)
If sNum = &quot;00&quot; Then
sBahtText = sBahtText &amp; &quot;ถ้วน&quot;
Else
If Left(sNum, 1) &lt;&gt; &quot;0&quot; Then sBahtText = sBahtText &amp; sDigit10(Left(sNum, 1))
If Right(sNum, 1) &lt;&gt; &quot;0&quot; Then sBahtText = sBahtText &amp; sNumber(Right(sNum, 1))
sBahtText = sBahtText &amp; &quot;สตางค์&quot;
If Left(sNum, 1) &lt;&gt; &quot;0&quot; Then sBahtText = Replace(sBahtText, &quot;หนึ่งสตางค์&quot;, &quot;เอ็ดสตางค์&quot;)
End If
End Function
</pre>
<p>เวลานำไปใช้ในแบบฟอร์มรายงานนะคับ</p>
<p><img class="alignnone size-full wp-image-61" title="sBahtText" src="http://www.ikapeng.com/wp-content/uploads/2010/02/sBahtText.jpg" alt="" width="387" height="197" /></p>
<p>พิมพ์ค่า =<strong><span style="color: #ff0000;">sBahtText</span></strong>(<strong><span style="color: #008000;"><em>ตัวแปร,ออบเจ็กค์,ที่ที่ต้องการแปลง</em></span></strong>) ลงในช่อง แหล่งควบคุม</p>
<p>ผลที่ได้ในรายงานคับ</p>
<p><img class="alignnone size-full wp-image-62" title="sBahtText-report" src="http://www.ikapeng.com/wp-content/uploads/2010/02/sBahtText-report.jpg" alt="" width="437" height="119" /></p>
<p>สามารถนำไปประยุกต์ใช้กับการพิมพ์ใบเสร็จได้เป็นอย่างดีเลยคับ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ikapeng.com/%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b9%80%e0%b8%a5%e0%b8%82%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99%e0%b8%95%e0%b8%b1%e0%b8%a7%e0%b8%ad%e0%b8%b1%e0%b8%81%e0%b8%a9%e0%b8%a3-%e0%b9%83%e0%b8%99-ms-access.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
