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 a caracter in a query

Status
Not open for further replies.

storm197

MIS
Oct 9, 2002
55
CA
Hi,

I'm trying to replace all accents (é,è and ê) for a e letter in a field.

I know that in SQL, the function REPLACE can be used, but is there any function in access that do it ?

If not, anyone have an idea of How I can replace my accents ?

Thank you
 
With the table open, Edit|Replace from the menu bar?

Randy
 
Sorry, I didn't explained my problem enough.

I do not want to append the data in the tables, I just want to remove the accents from the query result.

Thanx
 
Something like this? (not tested).....

Dim db As DAO.DataBase
Dim rs As DAO.RecordSet
Dim x As Integer
Dim y As String
Dim strField As String
Set db = CurrentDb
Set rs = db.OpenRecordset("qryResults")
With rs
.MoveFirst
Do Until .EOF
strField = ""
For x = 1 To len(rs!FieldName)
y = Mid(rs!FieldName,X,1)
If y = undesirable character Then
strField = strField & "e"
Else
strField = strField & y
End If
Next x
.Edit
rs!FieldName = strField
.Update
.MoveNext
Loop
End With
Set rs = Nothing
Set db = Nothing


Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top