Como convertir números en letras para impresión de cheques ms access 2007

Deseo convertir números que contienen decimales en letras y después imprimir un cheque, tengo un código que vi en este forum y me esta trabajando bien solo que no sale en pantalla la palabra de dolares o dolar dependiendo de el caso ni las de la cantidad sobre 100 ej yo escribo 123.45 y sale ciento ventitres cuarenta y cinco y lo que deseo es ciento ventitres dolares con 45/100.

Aquí esta el código que esa persona escribió, que por cierto no tuve que modificar nada esta perfecto pero para otras aplicaciones no para la que necesito.

Alguien podría ayudarme?

Option Compare Database
Sub nombreunidad(num As Integer)
Select Case num
Case 1
Texto = Texto & "un"
Case 2
Texto = Texto & "dos"
Case 3
Texto = Texto & "tres"
Case 4
Texto = Texto & "cuatro"
Case 5
Texto = Texto & "cinco"
Case 6
Texto = Texto & "seis"
Case 7
Texto = Texto & "siete"
Case 8
Texto = Texto & "ocho"
Case 9
Texto = Texto & "nueve"
Case 700
Texto = Texto & "sete"
Case 900
Texto = Texto & "nove"
End Select
End Sub
Sub nombredecena(num As Integer)
Dim dec, un
dec = 0
un = 0
Do Until num < 10
dec = dec + 1
num = num - 10
Loop
Do Until num < 1
un = un + 1
num = num - 1
Loop
Select Case dec
Case 1
Select Case un
Case 0
Texto = Texto & " diez"
Case 1
Texto = Texto & " once"
Case 2
Texto = Texto & " doce"
Case 3
Texto = Texto & " trece"
Case 4
Texto = Texto & " catorce"
Case 5
Texto = Texto & " quince"
Case 6
Texto = Texto & " dieciséis"
Case 7
Texto = Texto & " diecisiete"
Case 8
Texto = Texto & " dieciocho"
Case 9
Texto = Texto & " diecinueve"
End Select
Case 2
Texto = Texto & " veint"
If un = 0 Then
Texto = Texto & "e"
Else
Texto = Texto & "i"
End If
Case 3
Texto = Texto & " treinta"
Case 4
Texto = Texto & " cuarenta"
Case 5
Texto = Texto & " cincuenta"
Case 6
Texto = Texto & " sesenta"
Case 7
Texto = Texto & " setenta"
Case 8
Texto = Texto & " ochenta"
Case 9
Texto = Texto & " noventa"
End Select
If dec > 2 And un > 0 Then
Texto = Texto & " y "
End If
If dec > 1 And un > 0 Then
nombreunidad (un)
End If
End Sub
Private Sub Numero_LostFocus()
Dim mil, cen, dec, un, udec, ucen As Integer
Dim total As Double
Texto.Value = ""
mil = 0
cen = 0
dec = 0
un = 0
udec = 0
ucen = 0
total = Numero.Value
Do Until total < 1000
mil = mil + 1
total = total - 1000
Loop
Do Until total < 100
cen = cen + 1
total = total - 100
Loop
Do Until total < 10
dec = dec + 1
total = total - 10
Loop
Do Until total < 1
un = un + 1
total = total - 1
Loop
Do Until total < 0.1
udec = udec + 1
total = total - 0.1
Loop
Do Until total < 0.009
ucen = ucen + 1
total = total - 0.01
Loop
If mil > 1 Then
nombreunidad (mil)
End If
If mil > 0 Then
Texto = Texto & " mil"
End If
If cen > 1 Then
If cen = 5 Then
Texto = Texto & " quinientos"
Else
Texto = Texto & " "
If cen = 7 Or cen = 9 Then
nombreunidad (cen * 100)
Else
nombreunidad (cen)
End If
Texto = Texto & "cientos"
End If
Else
If cen = 1 Then
If dec > 0 Or un > 0 Then
Texto = Texto & " ciento"
Else
Texto = Texto & " cien"
End If
End If
End If
If dec > 0 Then
total = dec * 10 + un
nombredecena (total)
Else
If un > 0 Then
Texto = Texto & " "
nombreunidad (un)
End If
End If
If udec > 0 Or ucen > 0 Then
Texto = Texto & " con"
If udec > 0 Then
total = udec * 10 + ucen
nombredecena (total)
Else
If ucen > 0 Then
nombreunidad (ucen)
End If
End If
End If
End Sub

Añade tu respuesta

Haz clic para o