One of the fields in a table I've been given has multiple values separated by carriage returns. Can I used vb Replace to change those carriage returns to commas?
Yes, of course, you can use Replace in VBA - if you have the data in VBA but ...
... if what you're really asking is can you use Replace in SQL in Access then the answer is No - or not directly, so ...
... can you give a few more details of what you want to know?
Enjoy,
Tony
------------------------------------------------------------------------------------ We want to help you; help us to do it by reading this:Before you ask a question.
The field has unreadable characters separating values. The unreadable character is an ascii 2 (or double quote).
I know the third character is always an ascii 2.
I open a recordset in vba. I want to replace the ascii2 with a pipe |
strSQL = "Select tsindex, tlindex, tbatch, trecbuffer from ewin_tlabel"
Set rs = DB.OpenResults(strSQL)
Dim txt As String
Dim fld As Integer
txt = rs.Value("trecbuffer")
fld = Asc(Mid$(txt, 3, 1))
If InStr(rs.Value("trecbuffer"), fld) > 0 Then
txt = Replace(txt, fld, "|")
End If
My syntax is off or something, because although fld does return the ascii2, my If..isn't returning anything.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.