replace blank spaces with the ~ character

  • Thread starter Russ via AccessMonster.com
  • Start date
R

Russ via AccessMonster.com

Trying to replace blank spaces between my part number with the ~ character
Example;
01 0258 3256
new
01~0258~3256
Any help would be great.
Would like to keep it simple, maybe an update query???
 
P

Paolo

Hi Russ,
use replace function e.g. pt_nmbr="01 0258 3256"

pt_nmbr=replace(pt_nmbr," ","~")
now in pt_nmbr instead of spaces you'll have tilde. You can use replace in
an update query or in VBA code.

HTH Paolo
 
R

Russ via AccessMonster.com

worked perfect, thanks!
Hi Russ,
use replace function e.g. pt_nmbr="01 0258 3256"

pt_nmbr=replace(pt_nmbr," ","~")
now in pt_nmbr instead of spaces you'll have tilde. You can use replace in
an update query or in VBA code.

HTH Paolo
Trying to replace blank spaces between my part number with the ~ character
Example;
[quoted text clipped - 3 lines]
Any help would be great.
Would like to keep it simple, maybe an update query???
 
R

Russ via AccessMonster.com

Paolo,

How can I find and replace all the "/" with "/0"?

Thanks in advance
Hi Russ,
use replace function e.g. pt_nmbr="01 0258 3256"

pt_nmbr=replace(pt_nmbr," ","~")
now in pt_nmbr instead of spaces you'll have tilde. You can use replace in
an update query or in VBA code.

HTH Paolo
Trying to replace blank spaces between my part number with the ~ character
Example;
[quoted text clipped - 3 lines]
Any help would be great.
Would like to keep it simple, maybe an update query???
 
D

Douglas J. Steele

Replace(VariableName, "/", "/0")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Russ via AccessMonster.com said:
Paolo,

How can I find and replace all the "/" with "/0"?

Thanks in advance
Hi Russ,
use replace function e.g. pt_nmbr="01 0258 3256"

pt_nmbr=replace(pt_nmbr," ","~")
now in pt_nmbr instead of spaces you'll have tilde. You can use replace in
an update query or in VBA code.

HTH Paolo
Trying to replace blank spaces between my part number with the ~
character
Example;
[quoted text clipped - 3 lines]
Any help would be great.
Would like to keep it simple, maybe an update query???
 
R

Russ via AccessMonster.com

Douglas, is there a way to combine the two.
I.e. get rid of all space and replace the"/" in one line of code or do you
have to one at a time?
Thanks for the help
Replace(VariableName, "/", "/0")
[quoted text clipped - 17 lines]
 
J

John Spencer

You can nest the replace calls.

Replace(Replace(VariableName, "/", "/0")," ","~")



John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Douglas, is there a way to combine the two.
I.e. get rid of all space and replace the"/" in one line of code or do you
have to one at a time?
Thanks for the help
Replace(VariableName, "/", "/0")
[quoted text clipped - 17 lines]
Any help would be great.
Would like to keep it simple, maybe an update query???
 
R

Russ via AccessMonster.com

worked perfect, thanks!

John said:
You can nest the replace calls.

Replace(Replace(VariableName, "/", "/0")," ","~")

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Douglas, is there a way to combine the two.
I.e. get rid of all space and replace the"/" in one line of code or do you
[quoted text clipped - 8 lines]
 
Top