views:

213

answers:

1

Users are pasting text from Lotus Notes into my VBA application. This is then being stored in Access. Sometimes the pasted text includes what I assume is a carriage return which, when pasted into a single line form control, is displayed in the application's forms as ¶.

However, as this won't paste in to the VBE, I am unable to add this to my list of illegal characters for SQL transactions. I have tried trapping Chr(10), Chr(13) and even the pilcrow symbol Chr(182), but nothing will allow detection and removal of this character.

Other than this the symbol causes no problems, it's just a display thing.

Is there any way I can detect this character and strip it from a string?

Edit: I've done some testing and got the application to tell me what the character code of the rightmost character is and it confirms it to be Chr(10) - will try a different tack and handle this as an exception.

+2  A: 

Handled this as an exception to the normal string cleansing and just trimmed the CR/LF off any strings. Simpler than I thought in the end, but it did have me stumped for a while.

Lunatik