Solved

copy/pasting invalid characters

Posted on 2004-09-23
2
176 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
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

831 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