=substitute (in Excel) equivalent for Access

respree

Active Member
Joined
Apr 14, 2003
Messages
258
Hello all:

I was wondering if there is the equivalent of Excel's =substitute formula for Access. I am trying to write a query that will look at a field within a table and when it finds a space in any of the records, it replaces it with a %20.

Am new to Access and it appears many of Excel's formulas carry over to Access, but the =substitute doesn't. Is it called something else.

Any help would be appreciated.

Thanks in advance.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try the replace function:

Replace(expression, find, replace[, start[, count[, compare]]])

Check VBA help - 'replace' for more.

HTH,
 
Upvote 0
Thank you for your response.

I must be doing something wrong. Could you tell me what is wrong with the formula below?

Stringname: Replace([Artist Names]!Fullname,"","%20",1,1,0)
 
Upvote 0
Try:

Stringname: Replace([Fullname]," ","%20")

I assume this is an expression in a query.

If this doesn't work, please tell me what kind of error you are getting.

HTH,
 
Upvote 0
Sorry, I made a slight adjustment to it and it does work.

Before:
Stringname: Replace([Artist Names]!Fullname,"","%20",1,1,0)

After:
Stringname: Replace([Artist Names]!Fullname,"","%20",1,10,0)

What was happening was that it found only the first space, but ignored the other spaces. The 'after' formula seems to fix this.

Many thanks again for your help. =)
 
Upvote 0

Forum statistics

Threads
1,223,447
Messages
6,172,201
Members
452,448
Latest member
Tupacandres

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top