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

  • Thread starter Thread starter Guest
  • Start date Start date
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 ...
 
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..
 
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)
 
Back
Top