F
Fred
I am trying to produce payment details on a preprinted
cheque using a report. The value of the cheque is
displayed in the report
and under this I want a separate field(s) with the
individual digits of the number shown in words eg
651,253 to be displayed
as 'Six' 'Five' 'One' 'Two' 'Five' 'Three.
I have the code that displays the value as Six Hundred
and Fifty One etc., but this is not what I want.
Someone replied with the following code:
I tried this by creating a module and pasting the code.
When I used Coverter([Field name]) I was taken to the VBA
code.
Please help
Thanks Fred
cheque using a report. The value of the cheque is
displayed in the report
and under this I want a separate field(s) with the
individual digits of the number shown in words eg
651,253 to be displayed
as 'Six' 'Five' 'One' 'Two' 'Five' 'Three.
I have the code that displays the value as Six Hundred
and Fifty One etc., but this is not what I want.
Someone replied with the following code:
Fred,
You can write a user defined function to return the individual number as
a text word.
Function Converting(NumIn)
' Convert numbers to their individual word.
Dim strY As String
Dim strString As String
Dim intX As Integer
For intX = 1 To Len(NumIn)
strY = Mid(NumIn, intX, 1)
If strY = "0" Then
strY = "10"
End If
strString = strString & Choose(Val (strY), "One", "Two",
"Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero")
Next intX
Converting = strString
End Function
======
You can call it from a control on a report, or as below, from a query:
TextWords:Converting([NumberField])
Hope this helps
I tried this by creating a module and pasting the code.
When I used Coverter([Field name]) I was taken to the VBA
code.
Please help
Thanks Fred