Help wanted
I need to build a DB with numersous forms in it
Several of these form ask for alphabetic data only to be input (letters only)
I can write, using keypress methods, validation routines for these text boxes individually.
However, is there a way of writing a public function in a module and then calling this function from anywhere in my Db
I have tried the following
module code
Public Sub lettersonly(key As Integer)
Select Case key
Case 65 To 90, 97 To 122, 8, 32
key = key
Case Else
key = 0
End Select
End Sub
Form code
Private Sub txtname_KeyPress(keyascii As Integer)
lettersonly (keyascii)
End Sub
However it does not work, and the textbox still accepts non-alphabetical data
Any help would be greatly appreciated
Thanks
I need to build a DB with numersous forms in it
Several of these form ask for alphabetic data only to be input (letters only)
I can write, using keypress methods, validation routines for these text boxes individually.
However, is there a way of writing a public function in a module and then calling this function from anywhere in my Db
I have tried the following
module code
Public Sub lettersonly(key As Integer)
Select Case key
Case 65 To 90, 97 To 122, 8, 32
key = key
Case Else
key = 0
End Select
End Sub
Form code
Private Sub txtname_KeyPress(keyascii As Integer)
lettersonly (keyascii)
End Sub
However it does not work, and the textbox still accepts non-alphabetical data
Any help would be greatly appreciated
Thanks