I have code to check the input for specific characters in a text box.
My code catches the incorrect characters, gives a warning, but after the user closes the msgbox, the incorrect character is still entered

I am sure this will be a simple solution but I can't figure it out at the moment.

I have tried the following code in the KeyDown, KeyPress and the KeyUp and I get the same problem each time.
vb Code:
  1. Dim tmpDate As String
  2.     tmpDate = txtMembership(Index).Text
  3.    
  4.     Select Case Index
  5.         Case 11, 12, 13, 15
  6.             Select Case KeyAscii
  7.                 Case 8          'backspace
  8.                 Case 47         '/forward slash
  9.                 Case 48 To 59   'numbers
  10.                 Case 127        'Delete key
  11.                 Case Else
  12.                     MsgBox "You can only enter numbers and the ' / ' seperator when entering dates.", _
  13.                             vbOKOnly + vbInformation, "Date Format"
  14.                     'remove last character entered
  15.                     'Exit Sub
  16.                     txtMembership(Index).Text = tmpDate
  17.             End Select
  18.     End Select