Solved

Access 2003 Query Is Finding Fields With Non-Alphanumeric Data

Posted on 2013-01-22
4
348 Views
Last Modified: 2013-01-23
I can't seem to find an Access 2003  function that will remove all non-alphanumeric data from a field. My query is unable to summarize data because fields that contain identical data are not being properly Grouped because one of them contains what looks like boxes/squares at the end/far right of the field; I assume some type of carriage return or other non-alphanumeric placeholder.

I've already tried using the Trim function but it fails to eliminate the oddball data.

I should mention that this field is keyed by a user but is part of an ERP system so it may have also been ported or otherwise manipulated by one of the programs in our business system. Our system is written in Visual Basic and on top of an Access database if that helps.

Let me know if you need more information.
0
Comment
Question by:slamond
  • 2
4 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 38808112
try doing this, instead of Trim

replace(replace(replace([fieldName],chr(13) & chr(10),""),chr(13),""),chr(10),"")

or

trim(replace(replace(replace([fieldName],chr(13) & chr(10),""),chr(13),""),chr(10),""))
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 38808119
if that does not work, you will need VBA codes to determine those non printable characters and remove them.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38808125
Try this in place of the Trim() function.
Function CleanUpString(strInText As String) As String
    Dim p As Integer
    
    p = Len(strInText)
    If p = 0 Then
        Exit Function
    End If
    Do While Asc(Mid(strInText, p)) < Asc(" ")
        p = p - 1
        If p = 0 Then
            Exit Function
        End If
    Loop
    CleanUpString = Trim(Left(strInText, p))
End Function

Open in new window

0
 

Author Closing Comment

by:slamond
ID: 38811375
This simple formula works.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HasData 9 36
convert publisher file to an outlook email template 8 35
Run Time Error 3071 26 36
VB.NET return row from SQL to DataSet and get column values ? 3 26
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now