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.