473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Delete spaces of fields in access table

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
2 1778
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
2
by: LaurenW | last post by:
After many years of working with Access, I am FINALLY required to delete a single field from a table in a linked back-end data base and I must do it fro the FRONT end! There MUST be a way to do...
2
by: Michael Bulatovich | last post by:
I have a simple db to keep track of work/time/projects etc. It has two fields (column) named "start time" and "end time" WITH THE SPACES. I'm trying to do some automation to a form associated with...
7
by: ITM | last post by:
Can anyone tell me how I can prevent Access adding trailing spaces when I insert a value into a Text column? For example, if I execute the following statement: UPDATE Log SET Log.Title =...
5
by: hpi | last post by:
Hello, I have a table : Batch It contains fields batchnummer : Number (Long Integer) datum : Date/Time status : Number (Long Integer) nr_records : Number (Long Integer)
7
by: usenet | last post by:
I would like, if it's possible, to set the value of a field in a table to a number of spaces. One space would be fine, I just want to be able to set the field to a default value that's not NULL...
17
by: tommy | last post by:
Hi all, I' m adding strings to some fields in my table via Access. The strings sometimes have trailing spaces and I really need to have it that way, but Access truncates trailing spaces. How can...
3
by: igendreau | last post by:
I'm trying to clean up a database of mine, and I need to convert some old DAO code over to ADO. When I was using DAO, I had no problem running this script and deleting the record using rs.Delete. ...
31
by: matthewslyman | last post by:
I have an unusual design and some very unusual issues with my code... I have forced Access to cooperate on everything except one issue - record deletion. My form design involves a recursively...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.