Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace & with a space 1

Status
Not open for further replies.

Bennie47250

Programmer
Joined
Nov 8, 2001
Messages
515
Location
US
Using Access 2003

I have a text string that MAY include the & character. If the & exist, I need to replace it with a space. For example, “LATCH CABLE SPO/A7/9EH1&2” would be updated to “LATCH CABLE SPO/A7/9EH1 2”

I would like to do this in a Query or a Macro, is this possible? If yes, please give me an example.

Given what we had sold for a day, it is possible that none of the records will have an & or maybe only 1 out of 20 will.

Thanks
Bennie
 
Yep, no problem. Have a look at the Replace() function.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I will look at it again. First time I tried, it replaced the entire string LATCH CABLE SPO/A7/9EH1&2 with the space.
 
I can only guess that would be to do with the ordering of the parameters passed to the function. Try using the Replace() function like this:
Code:
Replace(yourfield,"&"," ")
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
If at first you don't succeed, try, try again. Thanks Harley, that worked exactly as needed.
 
Glad I could help, thanks for the star [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top