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 / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

I have a pcode held as DL32DP how do I add a space (ACCESS)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Doll - 01 Nov 2006 17:59 GMT
I want to include a space to the above. How can I achieve this?
Klatuu - 01 Nov 2006 19:06 GMT
= "DL32DP" & Space(1)

> I want to include a space to the above. How can I achieve this?
John Spencer - 01 Nov 2006 20:27 GMT
Add a space where?  At the beginning, at the end, some specific position in
the middle?

Adding a space could give you any of the following

 [ DL32DP] or [DL32DP ] or [DL 32DP] or [DL32 DP] or [DL32D P] or ...

>I want to include a space to the above. How can I achieve this?
TonyT - 01 Nov 2006 21:02 GMT
Hi Doll,

I've used something like the following to do the same before;

If Len(fldWithPCodeIn) = 7 Then
  fldToShowCorrectPCode = Left(fldWithPCodeIn,4) & Space(1) &
Right(fldWithPCodeIn,3)
ElseIf Len(fldWithPCodeIn) = 6 Then
  fldToShowCorrectPcode = Left(fldWithPCodeIn,3) & Space(1) &
Right(fldWithPCodeIn,3)
Else: msgbox"Invalid Password"
End If

TonyT..

> I want to include a space to the above. How can I achieve this?
John Nurick - 01 Nov 2006 22:12 GMT
Hi Doll (I've never dared say that to a stranger before<g>)

If this is a UK postcode, you need to look for "number-letter-letter" at
the end, and slip the space in before that. Easier said than done. I'd
use the rgxReplace() function at
http://www.j.nurick.dial.pipex.com/Code/index.htm

I think this will do the trick, catching all or almost all UK postcodes
and ignoring most others.

 rgxreplace([PostCode], "^([A-Z][0-9A-Z]+)(\d[A-Z]{2})$", "$1 $2",
True)

>I want to include a space to the above. How can I achieve this?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
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.