copy/pasting invalid characters

I have a user that copies and pastes her email into a memo field.  The email has characters that cause the record to become corrupt.  Is there any way to strip out these characters before saving without knowing what they are?
DeebzAsked:
Who is Participating?
 
JonoBBConnect With a Mentor Commented:
Something like this?

Dim FindTerm(13)
Dim strMemoField as string

'Set invalid characters to replace
    FindTerm(0) = "*"
    FindTerm(1) = "@"
    FindTerm(2) = "\"
    FindTerm(3) = "("
    FindTerm(4) = ")"
    FindTerm(5) = "["
    FindTerm(6) = "]"
    FindTerm(7) = "?"
    FindTerm(8) = "<"
    FindTerm(9) = ">"
    FindTerm(10) = "!"
    FindTerm(11) = "{"
    FindTerm(12) = "}"
    FindTerm(13) = ":"

'Work on the field
   strMemoField = me.txtMemoField
   For i = 1 To 13
     strMemoField = Replace(strMemoField, FindTerm(i), " ")
   Next

'Put the data back
  me.txtMemoField = strMemoField    

0
 
shanesuebsahakarnCommented:
jadedata mentioned a while ago that directly updating a memo field can cause corruption. You might want to try using an unbound form to enter data and then using a recordset to update the data in your table.
0
All Courses

From novice to tech pro — start learning today.