Converting Numbers to Words

O

Omar

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
 
K

Khusro

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
 
J

John Spencer

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
 
V

vanderghast

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
 
K

Khusro

No It is not, Do I need to supply the text box references in the function?,
but how?
 
V

vanderghast

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
 
S

Sajjad

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

Thanks,
 
D

Douglas J. Steele

Joe's code is a function. You can call the function for a report just as
easily as you can from a form.
 
J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top