Solved

Access 2003 Query Is Finding Fields With Non-Alphanumeric Data

Posted on 2013-01-22
4
351 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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…

770 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