title: Don't allow specific letters in ALL textbox for MS Access
body: <p>On a form, i have 13 <code>textbox</code>. When user click on save button, Access calls an API and passes the values in these text boxes to the API (via HTTP REST)</p>
  
  <p>There are some characters which are not allowed like <code>"</code> not allowed to be saved through API. Hence I want to restrict users from Entering these Characters.</p>
  
  <p>Currently I have created a <code>Public</code> <code>Function</code> which is called from <code>KeyPress</code> Event to check if the Characters are allowed or Not. But I have to call this function from every <code>textbox</code>  <code>KeyPress</code> event. <em>Is there a way to not allow <code>"</code> across all the text boxes??</em></p>
  
  <p><strong>Function</strong></p>
  
  <pre><code>Public Function CharsNotAllowed(myChar As Integer) As Integer
  
      If myChar = 34 Then
          Beep 'Let the user know they hit an illegal key
          CharsNotAllowed = 0 'Don't let the keystroke through
      Else
          CharsNotAllowed = myChar
      End If
  
  End Function
  </code></pre>
  
  <p><strong>Function Calling</strong></p>
  
  <pre><code>Private Sub StudentName_KeyPress(KeyAscii As Integer)
      KeyAscii = CharsNotAllowed(KeyAscii)
  End Sub
  
  Private Sub StudentClass_KeyPress(KeyAscii As Integer)
      KeyAscii = CharsNotAllowed(KeyAscii)
  End Sub
  
  'and so on for all the 13 text boxes
  </code></pre>
  
  <p><em>Note</em> : <code>34</code> represents <code>"</code>  </p>