Code that was working doesn't anymore -Remove ALT-ENTER from Excel

  • Thread starter Thread starter BlueWolverine
  • Start date Start date
B

BlueWolverine

Hello,
MS ACCESS 2003 on XP PRO.

UPDATE t_OIS SET t_OIS.Instructions =
Replace([t_OIS.Instructions],Chr(10),Chr(13) & Chr(10))
WHERE (((InStr([t_OIS.Instructions],Chr(10)))>0) AND
((InStr([t_OIS.Instructions],Chr(13)))=0));

I used this to remove alt-enters from the excel dump and replace them with
the equivalent in access. Now it's giving me an error:

The Search key was not found in any record.

The criteria return plenty of records.

HELP!
 
Your brackets appear to be incorrect. The brackets should surround the
table name and field name separately.

UPDATE t_OIS
SET t_OIS.Instructions =
Replace([t_OIS].[Instructions],Chr(10),Chr(13) & Chr(10))
WHERE InStr([t_OIS].[Instructions],Chr(10)) >0
AND InStr([t_OIS].[Instructions],Chr(13))=0;

I would change the where clause to

WHERE Instructions LIKE "*" & Chr(10) & "*"
AND Instructions NOT LIKE "*" & Chr(13) & "*"

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Hi,

Usually that means that something is corrupted. Create a backup first.
Then try a compact and repair. If that does not help, try a
decompile/recompile (see http://www.granite.ab.ca/access/decompile.htm). If
that does not help, try creating a new database and importing everything from
the old one.

Clifford Bass
 
Compact and repair appears to have fixed it. Thank you.
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!


Clifford Bass said:
Hi,

Usually that means that something is corrupted. Create a backup first.
Then try a compact and repair. If that does not help, try a
decompile/recompile (see http://www.granite.ab.ca/access/decompile.htm). If
that does not help, try creating a new database and importing everything from
the old one.

Clifford Bass

BlueWolverine said:
Hello,
MS ACCESS 2003 on XP PRO.

UPDATE t_OIS SET t_OIS.Instructions =
Replace([t_OIS.Instructions],Chr(10),Chr(13) & Chr(10))
WHERE (((InStr([t_OIS.Instructions],Chr(10)))>0) AND
((InStr([t_OIS.Instructions],Chr(13)))=0));

I used this to remove alt-enters from the excel dump and replace them with
the equivalent in access. Now it's giving me an error:

The Search key was not found in any record.

The criteria return plenty of records.

HELP!
 
Back
Top