Question about changing the value of a field with an update query

V

Veli Izzet

Hi all,

I have a field where I keep the codes of items. The codes are in type
12-345-678-90. Now , I want to throw out the "-"s to have 1234567890.

Can I do this with an update query, how?

Thanks for answers.
 
D

Douglas J Steele

Update MyTable SET MyField = Replace(MyField, "-", "")

If you're using an unpatched version of Access 2000, you might run into
problems using Replace in a query. Applying the service packs should solve
the problem, or you can build your own "wrapper function":

Public Function MyReplace( _
String As Variant, _
ChangeFrom As String, _
ChangeTo As String _
) As String

MyReplace = Replace(String, _
ChangeFrom, ChangeTo)

End Function
 
Top