473,796 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1797
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(B yVal 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(strVal ue,intPos))
Loop
RemExtrapace = RemExtraSpace & strValue
End Function

Nov 12 '05 #2
Salad wrote:
Private Function RemExtraSpace(B yVal 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(strVal ue,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
3877
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 table, or perhaps bytes, being updated where the engine just decides, screw it, i'll just make a new one. surfed this group and google, but couldn't find anything. the context: we have some java folk who like to parametize/
2
3209
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 this. SQL ALTER TABLE code does not work because the table is linked. I cannot find a "Delete field" method in DAO. I hope I'm overlooking it. Any advice will be appreciated.
2
11140
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 the db and notice that in all the examples I've seen nobody EVER includes spaces in the names of fields. Now I'm getting a sinking feeling.... Can anyone quickly outline the kinds of problems I'm going to encounter with these names? --
7
7423
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 = 'Testing' WHERE Log.Identifier=1; ....then the following statement:
5
5042
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
7944
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 but also doesn't show anything when the field is displayed. Is this possible or would it be a 'bad thing'? -- Chris Green
17
11886
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 I force Access not to truncate?! Thanx, /Toommy
3
6130
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. But when I rework the code in ADO, it tells me I can't delete it because there are related records in another table. Never had that problem in DAO and I haven't touched the relationships. Ignore most of this code and focus on the recordset "rs"....
31
6686
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 nested form. In other words, the form, m_settings_menueditor_recursive has a single subform; m_settings_menueditor_recursive (both are viewed as datasheets - so the form is its own subdatasheet.) The Form_Open event modifies the form's recordset so...
0
9683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.