Selective editing of a text field

S

Sirocco

Is there a way to change every occurrence of "Street" to "St" in a text
field that also includes the rest of the street address?

Many thanks in advance.
 
F

fredg

Is there a way to change every occurrence of "Street" to "St" in a text
field that also includes the rest of the street address?

Many thanks in advance.

If you are using Access 2000 or newer you can use the Replace()
function:
=Replace([FieldName],"Street","St")

Be aware, that in some earlier versions of Access 2000, you may have
to create a user defined function (in a module) first, and refer to
that function instead:

Function ChangeStreet(FieldIn as String) as String
ChangeStreet =Replace(FieldIn,"Street","St")
End Function

Then in the query you would use:
Exp:ChangeStreet([FieldName])
 
S

Sirocco

I'm glad I asked. This is one of those things I wish I knew years ago -
definitely a cool trick that will go into my personal Access Bible. Thanks
again.



fredg said:
Is there a way to change every occurrence of "Street" to "St" in a text
field that also includes the rest of the street address?

Many thanks in advance.

If you are using Access 2000 or newer you can use the Replace()
function:
=Replace([FieldName],"Street","St")

Be aware, that in some earlier versions of Access 2000, you may have
to create a user defined function (in a module) first, and refer to
that function instead:

Function ChangeStreet(FieldIn as String) as String
ChangeStreet =Replace(FieldIn,"Street","St")
End Function

Then in the query you would use:
Exp:ChangeStreet([FieldName])
 
Top