Help With the Replace Function

  • Thread starter Thread starter CB
  • Start date Start date
C

CB

Hello,
I need to replace multiple characters in a Replace statement and can't
figure out how to do more than one. Any advice? My starting statement is
below (using & as the find string).

Ship-to Name: Replace([Sales Header].[Ship-to Name],"&","")
 
The default values for the optional fourth through sixth arguments should
work for you, but try actually putting them in, as noted below:

Ship-to Name: Replace([Sales Header].[Ship-to Name],"&","", 1, -1, 1)
 
By "multiple characters" do you mean a "&" in one spot and perhaps a "-" in
another spot in the string, but that the two characters may not occur
together? If so, just run more than one Replace statement. If they do occur
together, you should be able to put them together in the "find what"
section.

Examples:
Ship-to Name: Replace([Sales Header].[Ship-to Name],"&-","")

Ship-to Name: Replace(Replace([Sales Header].[Ship-to Name],"&",""), "-",
"")
 
THANK YOU SOOOO MUCH!

I'm not that great at Access. This made my day.
Wayne Morgan said:
By "multiple characters" do you mean a "&" in one spot and perhaps a "-" in
another spot in the string, but that the two characters may not occur
together? If so, just run more than one Replace statement. If they do occur
together, you should be able to put them together in the "find what"
section.

Examples:
Ship-to Name: Replace([Sales Header].[Ship-to Name],"&-","")

Ship-to Name: Replace(Replace([Sales Header].[Ship-to Name],"&",""), "-",
"")

--
Wayne Morgan
Microsoft Access MVP


CB said:
Hello,
I need to replace multiple characters in a Replace statement and can't
figure out how to do more than one. Any advice? My starting statement is
below (using & as the find string).

Ship-to Name: Replace([Sales Header].[Ship-to Name],"&","")
 
Back
Top