By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,220 Members | 1,008 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,220 IT Pros & Developers. It's quick & easy.

Delete spaces of fields in access table

P: n/a
Hello:

i want to know how to delete inner spaces between words of a field in a
access table?
For example, i need to convert a text field like

"one two etc" in
"one two etc"

The online documentation talk about a "ESPACIOS()" function, but it
doesnt work neither in a SELECT statement neither VB function.

Thanks for help.

Francisco.

PD: please reply to my personal email.... thanks.

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Francisco wrote:
Hello:

i want to know how to delete inner spaces between words of a field in a
access table?
For example, i need to convert a text field like

"one two etc" in
"one two etc"

The online documentation talk about a "ESPACIOS()" function, but it
doesnt work neither in a SELECT statement neither VB function.

Thanks for help.

Francisco.

PD: please reply to my personal email.... thanks.


Private Function RemExtraSpace(ByVal strValue As String) As STring
Dim intPos As Integer
Do While (Instr(strValue," ") > 0)
intPos = Instr(strValue," ")
RemExtraSpace = RemExtraSpace & Left(strValue, intPos-1) & " "
strValue = Trim(Mid(strValue,intPos))
Loop
RemExtrapace = RemExtraSpace & strValue
End Function

Nov 12 '05 #2

P: n/a
Salad wrote:
Private Function RemExtraSpace(ByVal strValue As String) As STring
Dim intPos As Integer
Do While (Instr(strValue," ") > 0)
intPos = Instr(strValue," ")
RemExtraSpace = RemExtraSpace & Left(strValue, intPos-1) & " "
strValue = Trim(Mid(strValue,intPos))
Loop
RemExtrapace = RemExtraSpace & strValue
End Function


Oh yeah. To call this. Ex:
Dim s As String
s = "Good Morning Franscisco"
msgbox RemExtraSpace(s)
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.