Replace Function

T

Terence

I am trying to export a file in a csv format. I need to
find away to replace "" in employees names (ex. "chuck").

If I export the file with the "" and try to import the
file again, the "" messes up the layout of the file.

Any help is appreciated.
 
J

John Vinson

I am trying to export a file in a csv format. I need to
find away to replace "" in employees names (ex. "chuck").

If I export the file with the "" and try to import the
file again, the "" messes up the layout of the file.

Any help is appreciated.

Try

Replace([namefield], """", "'")

to change "Chuck" to 'Chuck'

Note that the Replace() function may not be available in queries in
Access2000 and earlier versions; you might need to write a dumb little
wrapper function:

Public Function QReplace(strIn As String, strOld As String, strNew As
String) As String
QReplace = Replace(strIn, strOld, strNew)
End Function
 
T

Terence

John,

Thanks. The replace function worked perfectly.
-----Original Message-----
I am trying to export a file in a csv format. I need to
find away to replace "" in employees names (ex. "chuck").

If I export the file with the "" and try to import the
file again, the "" messes up the layout of the file.

Any help is appreciated.

Try

Replace([namefield], """", "'")

to change "Chuck" to 'Chuck'

Note that the Replace() function may not be available in queries in
Access2000 and earlier versions; you might need to write a dumb little
wrapper function:

Public Function QReplace(strIn As String, strOld As String, strNew As
String) As String
QReplace = Replace(strIn, strOld, strNew)
End Function


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top