Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21246

function returning value

$
0
0
Sir,

I am trying to write a function which check that the numeric key is pressed and if not returns null/blank in the textbox and on write key writes the value

so the event and functions are as follows :

Private Sub txtloanamt_KeyPress(keyascii As Integer)
ky = keyascii
keyascii = checknumber(ky)
End Sub




Public Function checknumber(ky) As Integer
If ky < 48 Or ky >= 65 Then '65=capital A and 122=small letter z
MsgBox "Please enter only numeric value"
keyascii = 0
Else
ky = ky

End If

End Function


Pl. give correction and guide me.


thanks

Viewing all articles
Browse latest Browse all 21246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>