Simple made programme for testing purpose.user take input from 1 to nine.and function convert that numeric number into text like one two ...nine. function is working fine .but the number in words is not comming in Upper case.Kindly let me know the idea.any help would be highly appreciated.

Public Function NumberToWords(x As Integer) As String 
  Dim Numbers(9) As String 
     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 Val(x) 
          Case 1: NumberToWords = "One" 
          Case 2: NumberToWords = "Two" 
          Case 3: NumberToWords = "Three" 
          Case 4: NumberToWords = "Four" 
                  MsgBox (NumberToWords) 
          Case 5: NumberToWords = "Five" 
                  MsgBox (NumberToWords) 
          Case 6: NumberToWords = "Six" 
          Case 7: NumberToWords = "Seven" 
          Case 8: NumberToWords = "Eight" 
          Case 9: NumberToWords = "Nine" 
        Case Else: NumberToWords = "" 
      End Select 
End Function 

Private Sub TxtAmount_KeyPress(KeyAscii As Integer) 
KeyAscii = Asc(UCase(Chr(KeyAscii))) 
End Sub 

Private Sub TxtAmount_LostFocus() 
Dim Amount As Integer 
Amount = Val(TxtAmount.Text) 
TxtPaymentInWords.Text = NumberToWords(Amount) 
End Sub 

Private Sub TxtPaymentInWords_KeyPress(KeyAscii As Integer) 
KeyAscii = Asc(UCase(Chr(KeyAscii))) 
End Sub

Because you don't have them in upper case. You have them in Propercase (Four, Five, Six). If you want them in all caps then use the UCase function or change your code. Also, if you set a breakpoint in TxtPaymentInWords_KeyPress, you will find out that when you go TxtPaymentInWords.Text = "string", the keypress event is not called because no keypress event happened, you just changed the text of the textbox.

Good Luck

This question has already been answered. Start a new discussion instead.