INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Microsoft: Access Tables and Relationships FAQ

## Code for Converting Number to

 Converting Number to Strings(Ex - 9 to Nine) by San22 faq700-1764 Posted: 10 Apr 02 Hello Everybody,Firstly I thank all of whom have helped in finding a code for converting numbers to string.I here am giving a totally different code which works perfectly till 9 CroresThe Code is ---Option Compare DatabasePublic Function Spell(InVal) As StringDim Ones(100) As VariantDim X(10) As VariantDim Real, Imax, Idigit(30), J, I1Dim Value As StringX(1) = ""X(2) = ""X(3) = " Hundred "X(4) = " Thousand "X(5) = ""X(6) = " Lakh "X(7) = ""X(8) = " Crore "X(9) = ""Ones(1) = " One "Ones(2) = " Two "Ones(3) = " Three "Ones(4) = " Four "Ones(5) = " Five "Ones(6) = " Six "Ones(7) = " Seven "Ones(8) = " Eight "Ones(9) = " Nine "Ones(10) = " Ten "Ones(11) = " Eleven "Ones(12) = " Twelve "Ones(13) = " Thirteen "Ones(14) = " Fourteen "Ones(15) = " Fifteen "Ones(16) = " Sixteen "Ones(17) = " Seventeen "Ones(18) = " Eighteen "Ones(19) = " Nineteen "Ones(20) = " Twenty "Ones(30) = " Thirty "Ones(40) = " Fourty "Ones(50) = " Fifty "Ones(60) = " Sixty "Ones(70) = " Seventy "Ones(80) = " Eighty "Ones(90) = " Ninety "Ones(100) = " Hundred "Real = Int(InVal)Imax = Len(Real)Value = ""For i = 1 To Imax    Idigit(i) = Real - 10 * Int(Real / 10)    Real = Int(Real / 10)Next iFor i = 1 To Imax    I1 = Imax - i + 1    J = Idigit(I1)    If I1 <> 9 Then GoTo 60    If J <> 1 Then GoTo 65    J = 10 + Idigit(I1 - 1)    i = i + 1    I1 = I1 - 1    GoTo 9965:    J = 10 * J    If Idigit(I1) = 0 And Idigit(I1 - 1) = 0 Then        i = i + 1        GoTo 100    End If60:    If I1 <> 7 Then GoTo 80    If J <> 1 Then GoTo 85    J = 10 + Idigit(I1 - 1)    i = i + 1    I1 = I1 - 1    GoTo 9985:    J = 10 * J    If Idigit(I1) = 0 And Idigit(I1 - 1) = 0 Then        i = i + 1        GoTo 100    End If80:    If I1 <> 5 Then GoTo 90    If J <> 1 Then GoTo 75    J = 10 + Idigit(I1 - 1)    i = i + 1    I1 = I1 - 1    GoTo 9975:    J = 10 * J    If Idigit(I1) = 0 And Idigit(I1 - 1) = 0 Then        i = i + 1        GoTo 100    End If90:    If I1 <> 3 Then GoTo 95    If Idigit(I1) = 0 Then GoTo 10095:    If I1 <> 2 Then GoTo 99    If J <> 1 Then GoTo 98    J = 10 + Idigit(I1 - 1)    i = i + 1    I1 = I1 - 1    GoTo 9998:    J = 10 * J99:    Value = Value + Ones(J) + X(I1)100:Next iSpell = ValueEnd Function---If any bugs r present plz let me know.Thankz Back to Microsoft: Access Tables and Relationships FAQ Index Back to Microsoft: Access Tables and Relationships Forum

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!