RetiredCoder
Technical User
I WAS a proggrammer 10 years ago. I told a political canidate that I would fix a db that they had already built. I built the following code to delete the numeric part of an address leaving the street name (so, 11357 N. Decatur Bvd. would give me N. Decatur Bvd.). I have consistantly recieved the "compile error type mismatch" error and can't get past it.
Can you help?
Thanks
Ron Hardesty
Old time codding...
Can you help?
Thanks
Ron Hardesty
Old time codding...
Code:
Option Explicit
Function AlphaAddress() ' (ByVal xAddress As String) As Long
' Dim intA As Long
' Dim lxAddressLength As Long
' Dim intX As Long
' xAddress = "11357 N. Decatur Blvd."
'
' Initialize
' intA = Len(xAddress)
' intA = 22
' intX = 0 ' number of bytes from the left
' lxAddressLength = 22 ' Len(xAddress) 'How many char from the right
'lxAddressLength = 22
'intX = 1
' CheckCharacter
' If Left$(xAddress, intX) = "0" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "1" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "2" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "3" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "4" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "5" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "6" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "7" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "8" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "9" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = "-" Then GoTo NoFoundNumeric
' If Left$(xAddress, intX) = " " Then GoTo NoFoundNumeric
' GoTo EurekaFoundIt
' NoFoundNumeric
' Chg length of xAddress
' lxAddressLength = 1 - lxAddressLength ' How many chars from the right
' intX = intX + 1 ' How many chars from the left
' GoTo CheckCharacter
' EurekaFoundIt
' figure out how many characters from the right
' to capture the non-numeric part of address
' a is the original length of address field
' lxAddressLength is the number of characters
' from the left to
' xAddress = Right$(xAddress, lxAddressLength)
' xAddress = UCase$(xAddress)
End Function
'Exit Function