Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Verification Command For VB6, Verification Issue

views
     
TSjackyap84
post Jan 21 2006, 02:24 PM, updated 20y ago

Casual
***
Junior Member
334 posts

Joined: Jan 2005


What is the command to verify the field for text box in VB6? If the text box only can accept characters, once the user key in numbers, it will prompt out a error msg. Anyone can show me the command?

The command below is only allow number to be key in.

Private Sub txtname_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii = 46 Or KeyAscii = vbKeyBack Then
Exit Sub
Else
KeyAscii = 0
Beep
End If

End Sub

What is the command to verify only characyers can be key in into textbox rather than number?

This post has been edited by jackyap84: Jan 21 2006, 02:42 PM

 

Change to:
| Lo-Fi Version
0.0113sec    1.31    6 queries    GZIP Disabled
Time is now: 23rd December 2025 - 05:50 AM