Solved User defined Function not working (1 Viewer)

MAAS8000

Registered User.
Local time
Yesterday, 22:35
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
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:35
Joined
Jul 9, 2003
Messages
16,280
Try this code:-

 

MAAS8000

Registered User.
Local time
Yesterday, 22:35
Joined
Apr 3, 2018
Messages
38
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

  • AboBelal.txt
    19.1 KB · Views: 220

MAAS8000

Registered User.
Local time
Yesterday, 22:35
Joined
Apr 3, 2018
Messages
38
Sorry, the problem was in calling the function, it was a stupid mistake
 

Users who are viewing this thread

Top Bottom