Solved

copy/pasting invalid characters

Posted on 2004-09-23
2
179 Views
Last Modified: 2011-10-03
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?
0
Comment
Question by:Deebz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 12135195
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
 
LVL 8

Accepted Solution

by:
JonoBB earned 500 total points
ID: 12135292
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question