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 / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

Padding string

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 29 Jan 2006 06:08 GMT
Hi

Is there a way in access 97 to pad a string with spaces such that the
resultant string is always x characters long?

Thanks

Regards
RoyVidar - 29 Jan 2006 10:39 GMT
John wrote in message <#Gy9zpJJGHA.1832@TK2MSFTNGP11.phx.gbl> :
> Hi
>
[quoted text clipped - 4 lines]
>
> Regards

I think the String function exists a97. Say you have a variable strTest
containint "hello"

strNewWar = strTest & String(20 - len(strTest), "@")

I think also the LSet statement could be used

strNewWar = "12345678901234567890"
LSet strNewWar = strTest

Signature

Roy-Vidar

steve.minnaar - 29 Jan 2006 10:50 GMT
strOut = Left$(strIn & Space$(x), x)

MS Access - A legend in it's own time.
 
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.