Courtesy of yrwyddfa and I, with a few slight modifications:

VB Code:
  1. Declare Sub RtlMoveMemory Lib "kernel32" ( _
  2.     ByRef lpvDest As Any, _
  3.     ByRef lpvSrc As Any, _
  4.     ByVal cbLen As Long _
  5. )
  6.  
  7. Function InStr2CharCount( _
  8.     ByVal pszString As Long, _
  9.     ByRef pszFind1 As String, _
  10.     ByRef pszFind2 As String _
  11. ) As Long
  12. Static chBuf(1024)  As Byte
  13. Dim chSearchChar1   As Byte
  14. Dim chSearchChar2   As Byte
  15. Dim lStringLen      As Long
  16. Dim i               As Long
  17.  
  18.     RtlMoveMemory lStringLen, ByVal (pszString - 4), 4&
  19.     RtlMoveMemory chBuf(0), ByVal pszString, lStringLen
  20.  
  21.     chSearchChar1 = AscW(pszFind1)
  22.     chSearchChar2 = AscW(pszFind2)
  23.     For i = 0 To lStringLen Step 2
  24.         If (chBuf(i) = chSearchChar1) Or (chBuf(i) = chSearchChar2) Then _
  25.             InStr2CharCount = InStr2CharCount + 1
  26.     Next i
  27. End Function
  28.  
  29. ' Usage:
  30. MsgBox Instr2CharCount(StrPtr(Trim$(txtInput.Text)), ".", "?")