Update Query Using Replace Worked in 2013 but not in 365 (1 Viewer)

AndrewInCornwall

New member
Local time
Today, 23:53
Joined
Feb 8, 2022
Messages
3
After a hard disc failure I've been forced to upgrade from running Access 2013 on Windows 7 to Office 365 on Windows 10

An upgrade query that worked fine before (for many years) would replace spaces with dashes.

The Update To contained:
Replace([Stock]![stkItemURL]," ","-")

But now, with the new version, if I try to run this query I get a type conversion error, and if I still chose to run the query it just removes all data from that field.

I'm hoping someone has a solution for me that doesn't involve vba as I haven't a clue about that (I do everything with queries)

Andrew
 

AndrewInCornwall

New member
Local time
Today, 23:53
Joined
Feb 8, 2022
Messages
3
Try using Cstr() as a test?
Thank you very much indeed for your reply.

I put the update inside the Cstr() and it worked a treat.

So just incase anyone reads this who had the same problem and is as thick as me, what worked is below:

Cstr(Replace([Stock]![stkItemURL]," ","-"))
 

Gasman

Enthusiastic Amateur
Local time
Today, 23:53
Joined
Sep 21, 2011
Messages
10,853
TBH I would have just surrounded the field with CStr(), but if that works as well :)
 

Users who are viewing this thread

Top Bottom