Converting Numbers to Words

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello everyone
I am building a financial application for my company and I was wondering
whether there is a function or a DLL that helps in converting the invoice
amount into words
Thanks in advance
cheers
 
I created two text boxes on a form A and B , I copied the code in a module
and set the data source property of Text B is =English() . when I insert
number in Text A , It does't work . I am new in programming kindly explain
step by step

thks
 
You need to reference the value you want to convert. You can try the
following, but you might need to refresh the screen to see the value or
otherwise force an update of the Text B control.

=English([Text A])

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
To the contrary of Excel, in Access, the Recalc is turned off by default
(and you cannot turn it on). So, you have to force a Recalc to occur,
explicitly. One possible way is to add a procedure handling the After Update
event for control TextA, in which you can type:

Me.Recalc


which forces all the formula in the form to be re-evaluated. That will make
your TextB control to recompute English( ). Note that since English does
not use any argument, I fail to see how it may work (on 'which' value does
it operates? ) but I assume the control name supplying the numerical value
is hard-coded in your function, right?



Vanderghast, Access MVP
 
Do you need to supply the textbox reference? yes.
How? Like John suggested. Your function must accept an argument:

-------------
Public Function English( TheValue As Variant) As String

If IsNull(TheValue) Then
English = vbNullString
exit sub
End if

... ' built the result using TheValue value
' which is not null (empty)

End Function
---------------


And in TextB, assign its control source to

= English( TextA )

as example.


Vanderghast, Access MVP
 
Converting number to text, the Joe Foster's code works well with forms, but
how do I do the same in a report?

Thanks,
 
Joe's code is a function. You can call the function for a report just as
easily as you can from a form.
 
Converting number to text, the Joe Foster's code works well with forms, but
how do I do the same in a report?

In exactly the same way as on a form.

Call the function from the website in the Control Source of a textbox, or as a
calculated field in a query.
 
Back
Top