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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Windows 11 Windows 11 update 5
Mailing Address 5
Mailing Address 3
Suppressing address lines 12
Can Anyone Improve This Utility? 2
error 3265 Item not in this collection? 3
Question on DropDownList 2
Address Envelope with Trim 1

Back
Top