The boxes indicate that those are undisplayable characters. May be line
feeds or carriage returns. You could (if you're using ACCESS 2002 or higher,
or if you're using ACCESS 2000 and have SP6 update to Jet 4.0 engine) use
Replace function to strip those characters from the text string as you
update the data from the imported text file. To do this, you'll need to
identify what the character is. You can do this by running a Select query
that would look something like this:
SELECT PartID, Asc(Left([PartID, 1)) AS CharNumber
FROM TableName
WHERE Left([PartID]) Not Like "[A-Z0-9]";
This will show you the ASCII number of the nonalphanumeric character so that
you will know what to use in the Replace function.
To strip the strange character in the update query (alternatively, you could
use an append query if you plan to copy the data into a new, permanent
table):
UPDATE TableName
SET PartID = Replace([PartID], Chr(#), "");
where the # character is to be replaced by the number that you get for the
ASCII number in the first query.
--
Ken Snell
<MS ACCESS MVP>
Ray said:
Hello All, I am having problems when I import text files into Access and
then running a query to clean the text. for expample: PARTID column have
some clean text and some unclean text (square small boxes at the beginning
of some Part ID's) How can i get rid of these? Currently I have to export to
Excel and then use the Clean(PARTID) function. Your help would be greatly
apprceiated.