First - What about zero???
The NumberToWords code can be simplified to
Code:
Public Function NumberToWords(X As Integer) As String
Dim Numbers(9) As String
Numbers(0) = "Zero"
Numbers(1) = "One"
Numbers(2) = "Two"
Numbers(3) = "Three"
Numbers(4) = "Four"
Numbers(5) = "Five"
Numbers(6) = "Six"
Numbers(7) = "Seven"
Numbers(8) = "Eight"
Numbers(9) = "Nine"
Select Case X
Case 0 To 9
NumberToWords = Numbers(X)
Case Else
NumberToWords = ""
End Select
End Function
Next. The keypress event happens BEFORE any validation or LostFocus event. You are converting any single character to upper case, but that doesn't affect the number. Then, on the lost focus event, you're converting a number to a text string which represents that number, but you're not converting to upper case THEN. That's where you should convert it, or, if it needs to happen earlier, the earliest possible place you could do so is within the NumberToWords function. Replace
Code:
NumberToWords = Numbers(X)
with
Code:
NumberToWords = Ucase(Numbers(X))
Or, for that matter, use upper case words in the Numbers array. "ONE," "TWO," "THREE," ...