Solved User defined Function not working

MAAS8000

Registered User.
Local time
Today, 12:58
Joined
Apr 3, 2018
Messages
38
I have a big Module to convert numbers to words. for example "1230" after using the function is expressed as "One thousand two hundred and thirty".
it works good in MS Excell. I have copied the same VBA Code in a module in my access project.
In one form I tried to use the function , I can find it the Access user defined functions but when I run it, the function not called
N.B.: it is very big module, I tried ti pick a small portion for the "The ones number" that is working well

Code:
Option Compare Database
Option Explicit

Public number_letter, number_word

Public Sub convert_number_word()
Dim first_Num, read_first
read_first = Left([number_letter], 1)
first_Num = Choose(read_first, "one", "two", "three", "four", "five", "six", "seven", "eight", "nine")
If Len([number_letter]) = 1 Then
[number_word] = first_Num
End If


End Sub

Function qweasd(Myno)
 number_letter = Myno
 convert_number_word
 qweasd = number_word
End Function
 
Try this code:-

 
this my arabic code. honestly it is not made by me i found it through the web and use it in Excell for several years. it works very well in excell but i couldn't use it in access. i may have a problem in calling the function or may need some edit in the VBA.
as my mother tounge is arabic, my code is very well in arabic conversion
 

Attachments

Sorry, the problem was in calling the function, it was a stupid mistake
 

Users who are viewing this thread

Back
Top Bottom