Results 1 to 5 of 5

Thread: creating a procedure(resolved)

Threaded View

  1. #1

    Thread Starter
    Lively Member dedub's Avatar
    Join Date
    Dec 2002
    Location
    NC
    Posts
    98

    creating a procedure(resolved)

    Hey all.

    I have this code to keep everything but numbers from being typed into a text box. (not mine) I have to call this code for several boxes. Instead of copy and pasting this several times I want to call it in a procedure. I created one but it didnot work. My guess is that I have to elaborate the procedure by passing something to it, like the key that was pressed instead of the number. Anyway, could somone help out if you understand. Thanks!

    Code:
    Private Sub Text2_KeyPress(KeyAscii As Integer)
    If (KeyAscii > 0 And KeyAscii <= 32) Or (KeyAscii > vbKey0 And KeyAscii <= vbKey9) Then
    Exit Sub
    Else
    KeyAscii = 0
    MsgBox "Please enter only numeric values"
    End If
    Last edited by dedub; Nov 2nd, 2003 at 09:37 PM.
    R.L.T.W. A+, NET+, CCNA

    Doin' my best

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width