Try searching Numword Module, it converts Numeric Currency into Text. or create new Module and put this Code in it.
After doing this just Write
=Numword(fieldname)
fieldname is name of your control.
Option Compare Database
Option Explicit 'Require explicit variable declaration
'This routine (c) 1994 Alan Simpson author of Understanding Access 2.0 by Sybex
'Variables used in NumWord() procedure defined here in Declarations.
Dim EngNum(120) As String
Dim StringNum As String, English As String
Dim NumArr(4) As Integer
Static Function NumWord(ByVal AmountPassed As Currency) As String
Dim i, WorkNum As Integer
If Not EngNum(1) = "One" Then
EngNum(0) = ""
EngNum(1) = "One"
EngNum(2) = "Two"
EngNum(3) = "Three"
EngNum(4) = "Four"
EngNum(5) = "Five"
EngNum(6) = "Six"
EngNum(7) = "Seven"
EngNum(8) = "Eight"
EngNum(9) = "Nine"
EngNum(10) = "Ten"
EngNum(11) = "Eleven"
EngNum(12) = "Twelve"
EngNum(13) = "Thirteen"
EngNum(14) = "Fourteen"
EngNum(15) = "Fifteen"
EngNum(16) = "Sixteen"
EngNum(17) = "Seventeen"
EngNum(18) = "Eighteen"
EngNum(19) = "Nineteen"
EngNum(20) = "Twenty"
EngNum(30) = "Thirty"
EngNum(40) = "Forty"
EngNum(50) = "Fifty"
EngNum(60) = "Sixty"
EngNum(70) = "Seventy"
EngNum(80) = "Eighty"
EngNum(90) = "Ninety"
End If
'** Convert incoming Currency value to a string for parsing.
StringNum = Format$(AmountPassed, "0000000.00"
'** Initialize other variables
English = ""
'** Just in case the check is for less than a buck...
If AmountPassed < 1 Then
English = "Zero"
End If
For i = 1 To 4
WorkNum = NumArr(i)
If (i = 4) And (NumArr(i) > 0) Then _
English = English & " and Paise"
If WorkNum > 99 Then
English = English & " " & EngNum(Int(WorkNum / 100)) & " Hundred"
WorkNum = WorkNum Mod 100
End If
If WorkNum > 19 Then
English = English & " " & EngNum(Int(WorkNum / 10) * 10)
If WorkNum Mod 10 > 0 Then _
English = English & " " & EngNum(WorkNum Mod 10)
Else
If WorkNum > 0 Then _
English = English & " " & EngNum(WorkNum)
End If
If (i = 1) And (NumArr(i) > 0) Then
English = English & " Lac"
Else
If (i = 2) And (NumArr(i) > 0) Then
English = English & " Thousand"
Else
If (i = 4) And (NumArr(i) > 0) Then
English = English
End If
End If
End If
Next i
NumWord = Trim(English)
End Function
Since the ?Poster? has indicated that the CStr function is what they wanted, I will not post the routine which will convert the Value to an "english" string representation of the value, as in 123.45 converted to "One hundred twenty three point four five"
If some one needs this functionality, please start a NEW thread and contact me directly with the thread title.
MichaelRed
m.red@att.net
There is never time to do it right but there is always time to do it over
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.