Hello
I created some ASCII code that only allows a backslash (\) and numeric chartacters to be entered in to a text box. The code works fine if its in the keypress event of a textbox.
However if i create the code in a module as a public function and try to call it from the key press function then the code fails (all spellings are correct) althought the function works when tested with other code.
Does anybody have any idea why i cant create a function to delete ascii characters.
This isnt a huge a problem but it will be easier to create a function than to put the code in to every keypreess event where it is needed. The code is below
Select Case KeyAscii
Case Is < 46
KeyAscii = 0
Case Is > 57
KeyAscii = 0
End Select
I created some ASCII code that only allows a backslash (\) and numeric chartacters to be entered in to a text box. The code works fine if its in the keypress event of a textbox.
However if i create the code in a module as a public function and try to call it from the key press function then the code fails (all spellings are correct) althought the function works when tested with other code.
Does anybody have any idea why i cant create a function to delete ascii characters.
This isnt a huge a problem but it will be easier to create a function than to put the code in to every keypreess event where it is needed. The code is below
Select Case KeyAscii
Case Is < 46
KeyAscii = 0
Case Is > 57
KeyAscii = 0
End Select