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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove square brackets 2

Status
Not open for further replies.

dinster

Programmer
Apr 12, 2007
54
GB
Hi all i have got data from oracle and placed it in access table.... in some of the fields it has square brackets. How do i get rid of the square brackets and replace them with carriage return.

Is there some sort of function i could do to loop through each field and replace the squares boxes and do carriage return?

Could some1 give me a small example to get me started?

many thanks

 
Easiest way is to use the built in Replace function;
Code:
Replace(Replace(yourdatahere,"[",""),"]",vbCrLf)

This replaces the opening square bracket with nothing, then the closing with a carriage return.

hth

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
Hi ben thankyou for replying....

I have tried that with slight alteration and nothing happens

test: Replace(Replace([ADMDATA_Diag],"[",""),"]","vbCrLf")

 
vbCrLf is a constant so remove the quotes.

TomCologne
 
Hi thanks it worked

also used this which is similar to wat u were saying

EXAM_Neuro1: Replace([EXAM_Neuro],Chr(10),Chr(13) & Chr(10),1,-1,1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top