Hi,
I have a field containing text. Some of the records have 'cr' characters (asc 10) at the end, others dont.
I want to remove them. As a start I've written a function to identify the affected records which works to a degree as follows:
This has been placed as a column in a query and succesfully identifies those with the offending character and those that don't. However when I tried to filter by entering "CR" in the criteria of this calculated column Access produces an error - "Run Time Error 5 - Invalid Procedure Call or Argument".
As not all the records need amending I need to identify them first, If I can't do this I'm stuck
Where am I going wrong, and is there an easy solution to my problem.
I have a field containing text. Some of the records have 'cr' characters (asc 10) at the end, others dont.
I want to remove them. As a start I've written a function to identify the affected records which works to a degree as follows:
Code:
Public Function stripCharacters(strAddress As String)
Dim strLastChar As String
Dim lngAscLastChar As Long
lngAscLastChar = Asc(strLastChar)
If lngAscLastChar = 10 Then
stripCharacters = "CR"
Else
stripCharacters = "None"
End If
End Function
As not all the records need amending I need to identify them first, If I can't do this I'm stuck
Where am I going wrong, and is there an easy solution to my problem.