Remove spaces from field?

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Hallo,

How can i remove spaces in a field?

value field zipcode: 9521 AP

should become: 9521AP

tried: trimm([zipcode]). But this doesn't work. Looked through the other
built in functions but do not understand which one does the trick...

Thanx for any tips!

Regards,

Harmannus
 
Harmannus said:
Hallo,

How can i remove spaces in a field?

value field zipcode: 9521 AP

should become: 9521AP

tried: trimm([zipcode]). But this doesn't work. Looked through the other
built in functions but do not understand which one does the trick...

Thanx for any tips!

Regards,

Harmannus
This would have been a good post in which you give your Access Version
number.

If you have Access 2000 or newer, in a query:
NewZip:Replace([ZipCode]," ","")

I believe some earlier Access 2000 versions do not permit using the
Replace function directly in a query. If your's does not, simply write a
public function in a module, using the above function. Then call it from
the query itself:

Public Function GetRidOfSpaces(TextIn)
GetRidOfSpaces = Replace(TextIn," ","")
End Function

NewZip:GetRidOfSpaces([ZipCode])

If you have Access 97 or older, you'll need to write your own user
defined function.
If you need help doing that, post back.
 
Hallo,

On posting i realised that i forgat to mention my Access version. Sorry!

I have Access2000. The replace function worked great!

Thanx!


Regards,

Harmannus


fredg said:
Harmannus said:
Hallo,

How can i remove spaces in a field?

value field zipcode: 9521 AP

should become: 9521AP

tried: trimm([zipcode]). But this doesn't work. Looked through the other
built in functions but do not understand which one does the trick...

Thanx for any tips!

Regards,

Harmannus
This would have been a good post in which you give your Access Version
number.

If you have Access 2000 or newer, in a query:
NewZip:Replace([ZipCode]," ","")

I believe some earlier Access 2000 versions do not permit using the
Replace function directly in a query. If your's does not, simply write a
public function in a module, using the above function. Then call it from
the query itself:

Public Function GetRidOfSpaces(TextIn)
GetRidOfSpaces = Replace(TextIn," ","")
End Function

NewZip:GetRidOfSpaces([ZipCode])

If you have Access 97 or older, you'll need to write your own user
defined function.
If you need help doing that, post back.
 
Back
Top