Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / December 2003

Tip: Looking for answers? Try searching our database.

help!!  remove the spaces!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
amy ratcliffe - 31 Dec 2003 09:14 GMT
hi

i am really stuck.  i have a field in a table and it has
a column of numbers some are in this format #### #####
#### #### ## or ### or #### and some are all together
################################.  I need to keep the
last 4 digits and am finding this dificult with the ones
with spaces.  Do you know how i can remove the spaces and
make it one whole number for me to deal with?

i hope this makes sense.

thank you very much :-)
Douglas J. Steele - 31 Dec 2003 10:00 GMT
Assuming that the numbers are being stored in text fields, and you're using
Access 2000 or higher, you can write a query that uses the Replace function
to correct your numbers:

MyNewField: Replace([MyOriginalField], " ", "")

Note that older versions of Access 2000 (i.e.: ones that haven't had all of
the service packs installed) may have problems using the Replace function in
a query. To get around that, write your own function that calls the Replace
function:

Function MyReplace(OriginalString As Variant, ChangeFrom As String, ChangeTo
As String) As Variant

  MyReplace = Replace(OriginalString, ChangeFrom, ChangeTo)

End Functioni

If you're using Access 97 or earlier, you'll have to write your own code to
mimic the Replace function. There's one approach in
http://www.mvps.org/access/strings/str0004.htm at "The Access Web"

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

> hi
>
[quoted text clipped - 9 lines]
>
> thank you very much :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.