Attribute VB_Name = "modKeypress" Option Explicit 'KEYPRESS Public Sub TextboxStrict(KeyAscii As Integer) If Chr(KeyAscii) = "'" Then KeyAscii = 0 ElseIf KeyAscii = vbKeyReturn Then WshShell.SendKeys "{Tab}" End If End Sub 'Period, Numbers, Backspace Public Sub TextboxNumber(KeyAscii As Integer) Select Case KeyAscii Case 46, 48 To 57, 8 Case vbKeyReturn: WshShell.SendKeys "{Tab}" Case Else: KeyAscii = 0 End Select End Sub 'Numbers, Backspace Public Sub TextboxNumeric(KeyAscii As Integer) Select Case KeyAscii Case 46, 48 To 57, 8 Case vbKeyReturn: WshShell.SendKeys "{Tab}" Case Else: KeyAscii = 0 End Select End Sub 'UCase Alpha, Backspace, Space Public Sub TextboxAlphaUCase(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) Select Case KeyAscii Case vbKeyReturn: WshShell.SendKeys "{Tab}" Case Chr(KeyAscii) = "'": KeyAscii = 0 'Case Else: KeyAscii = 0 End Select End Sub 'Alpha, Backspace, Space Public Sub TextboxAlpha(KeyAscii As Integer) Select Case KeyAscii Case 65 To 90, 97 To 122, 8, 32, 40, 41 Case vbKeyReturn: WshShell.SendKeys "{Tab}" Case Else: KeyAscii = 0 End Select End Sub Public Function Numerals() As String 'Return the Numerals string for specific use in filtering keystrokes Numerals = "1234567890" End Function Public Function NamePunctDelimiter(Argvalue As String, KeyAscii As Integer) As Integer If Len(Trim$(Argvalue)) = 0 Then If Chr$(KeyAscii) = " " Or Chr$(KeyAscii) = "," Then NamePunctDelimiter = 0 Else NamePunctDelimiter = KeyAscii End If Else If InStr(Argvalue, ",") > 0 And Chr$(KeyAscii) = "," Then NamePunctDelimiter = 0 Else NamePunctDelimiter = KeyAscii End If End If End Function Public Function UpTrim$(Argvalue As String) 'Returns the upper-cased and trimmed format of a string variable UpTrim$ = UCase$(Trim$(Argvalue)) End Function