I think that is because all you are doing is subtracting 32 of KeyAscii. You're not doing anything with KeyAscii after that, remember it is just a variable you defined. You actually need to take that converted character and append it to the characters in the text box.

Rather, if your exclusion code is working and the text box only accepts letters and numbers, why don't you just use toUpper() to convert the string to uppercase?

hericles has a point. It would be easier if you use textbox.text.toupper but if you must, absolutely must,convert lower case to upper case during the keypress event then here it is

Private Sub Tbx_AcctCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Tbx_AcctCode.KeyPress
Dim keyChar As Char = e.KeyChar
If AscW(keyChar) >= 97 And AscW(keyChar) <= 122 Then
e.KeyChar = (keyChar.ToString.ToUpper)
Else
If Not AscW(keyChar) >= 65 And AscW(keyChar) <= 90 Then
If Not AscW(keyChar) >= 48 And AscW(keyChar) <= 57 Then
If Not AscW(keyChar) = 8 Or AscW(keyChar) = 9 Or AscW(keyChar) = 13 Then
e.Handled = True
End If
End If
End If
End If
End Sub

you dont even need to do that.
all you need to do is add the name of the control you want this code to execute at the end of event handler declaration.
for example if you want to execute this code with textbox1, textbox2, textbox3 then you would write your declaration like following.

''this is an example of how you would handle each control differently
if sender is Tbx_AcctCode then
''code
elseif sender is textbox1 then
''code
elseif sender is textbox2 then
''code
elseif sender is textbox3 then
''code
end if

Textbox to enter account code i.e " Tbx_AcctCode " is added in different forms . to avoide typing same code in all forms i want to create function or sub and call as i used to do in VB6.

i dint get your below code how to work with it.

''this is an example of how you would handle each control differently
if sender is Tbx_AcctCode then
''code
else
if sender is textbox1 then
''code
elseif sender is textbox2 then
''code
elseif sender is textbox3 then
''code
end if