W
Wayne-I-M
Hi
I have a small module to get the numbers out of Post Codes (like zip codes)
which we use for an automated credit card payment system.
Public Function SplitPostCode(strInput As String) As String
Dim lngCounter As Long
Dim tmpChar As String
For lngCounter = 1 To Len(strInput)
tmpChar = Mid(strInput, lngCounter, 1)
If IsNumeric(tmpChar) Then
SplitPostCode = SplitPostCode & tmpChar
End If
Next lngCounter
End Function
To query
SELECT SplitPostCode([tblClients]![CDPostcode]) AS PCNum
FROM tblClients;
This works fine - But - the card companies are now insisting that (starting
in August) this year we send the numbers "as formated"
So if you have a postcode like this
WN4 7TH at the moment we send 47 but they want 4 7 (with a space)
WC1T3 8UF they want 13 8
UK post code are different length and so the space may by 3rd or 4th from
the left (or even - in the center of London - the 5th from the left). There
are always 3 digits after the space 1 number and 2 text.
I have a small module to get the numbers out of Post Codes (like zip codes)
which we use for an automated credit card payment system.
Public Function SplitPostCode(strInput As String) As String
Dim lngCounter As Long
Dim tmpChar As String
For lngCounter = 1 To Len(strInput)
tmpChar = Mid(strInput, lngCounter, 1)
If IsNumeric(tmpChar) Then
SplitPostCode = SplitPostCode & tmpChar
End If
Next lngCounter
End Function
To query
SELECT SplitPostCode([tblClients]![CDPostcode]) AS PCNum
FROM tblClients;
This works fine - But - the card companies are now insisting that (starting
in August) this year we send the numbers "as formated"
So if you have a postcode like this
WN4 7TH at the moment we send 47 but they want 4 7 (with a space)
WC1T3 8UF they want 13 8
UK post code are different length and so the space may by 3rd or 4th from
the left (or even - in the center of London - the 5th from the left). There
are always 3 digits after the space 1 number and 2 text.