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

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!
 
J

John Spencer

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
'====================================================
 
C

Clifford Bass

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
 
B

BlueWolverine

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top