[] Character stoping query

scottemotive

Registered User.
Local time
Today, 19:16
Joined
Oct 13, 2004
Messages
36
Hi

I have a text box bound to a field in a table, now ive noticed boxes appearing at the end of some lines (where i think users are pressing enter or shift+enter) in the text box
its kinda like [] now when i run a query on this table it does not output the full number of records i think it does not show anything after a record that contains one of these characters
does anyone know anything about this and suggest a method to fix it, ive been through my whole table looking for these characters but cant seem to output the full table still

thanks
 
If the user pressed Ctrl+Enter in the text box, in Access 2000 or higher you can run an Update Query to replace the Carriage Return and Line Feed characters with a Space:-

UPDATE [TableName] SET [FieldName] = Replace([FieldName],Chr(13) & Chr(10)," ")
WHERE InStr([FieldName],Chr(13) & Chr(10));


In some versions of Access 2000, you can't use the Replace() function directly in a query. You need to create a wrapper function in a module:
Code:
Public Function MyReplace(sText)
    MyReplace = Replace(sText, Chr(13) & Chr(10), " ")
End Function
and use the wrapper function in the query:

UPDATE [TableName] SET [FieldName] = MyReplace([FieldName])
WHERE InStr([FieldName],Chr(13) & Chr(10));
.
 

Users who are viewing this thread

Back
Top Bottom