2ippy
Newbie Here, Be gentle.
- Local time
- Today, 13:19
- Joined
- Nov 10, 2006
- Messages
- 78
Code:
Public Function ReplaceAbbreviatedNames(Address As String) As String
Dim PositionOfLastSpace As Integer
PositionOfLastSpace = InStrRev(Address, " ")
ReplaceAbbreviatedNames = Address
Select Case Mid(Address, PositionOfLastSpace + 1)
Case "st"
ReplaceAbbreviatedNames = Left(Address, PositionOfLastSpace) & "Street"
Case "rd"
ReplaceAbbreviatedNames = Left(Address, PositionOfLastSpace) & "Road"
Case "ave"
ReplaceAbbreviatedNames = Left(Address, PositionOfLastSpace) & "Avenue"
End Select
End Function
and...
Code:
Public Function fValidUKPostcode(strCodeToTest As String) As Boolean
Const c_REGEXP_UK_POSTCODE As String = _
"([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}" & _
"[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)"
If Len(strCodeToTest) Then
strCodeToTest = UCase(strCodeToTest)
Else
Exit Function
End If
With CreateObject("vbscript.RegExp")
.Pattern = c_REGEXP_UK_POSTCODE
fValidUKPostcode = .Test(strCodeToTest)
End With
End Function
I been shown 2 codes to help me with my forms for inputting addresses. I been playing with them but no sucess.
...help
