View Single Post
  #1 (permalink)  
Old February 13th, 2007, 08:45 PM
langsha langsha is offline
Registered User
Join Date: Feb 2007
Location: Teaneck, NJ, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using the Asc function


I'm new to this site and am hoping someone can help. I'm trying to find the ascii value of text entered into a text box. I've written the following code on the Key press event of a text box, but every time I type something in, I get a "Invalid procedure call or argument" error. Do I need to have a specific reference turned on or is there an issue with my code?

Thanks in advance for your help!

    Private Sub txt_String_KeyPress(KeyAscii As Integer)

         Dim Asc_Value As String

         Asc_Value = Asc(Me.txt_String.Text)
         MsgBox Asc(Asc_Value)

    End Sub

Reply With Quote