Hi
InStrRev gets the second space " " not first in A2k VBA6.
Here is part of my code
strStreet = "16 Hely St"
'Value actually from a database
'Value has been trimmed so has no leading or trailing white space.
I've tried these variations:
lngPosn = InStrRev(strStreet, " ")
lngPosn = InStrRev(strStreet, " ", -1, vbTextCompare)
lngPosn = InStrRev(strStreet, " ", len(strStreet), vbTextCompare)
lngPosn = InStrRev(strStreet, Chr(32), -1, vbTextCompare)
lngPosn = InStrRev(strStreet, Chr(32))
lngPosn = InStrRev(strStreet, Chr(32), -1, vbBinaryCompare)
The result is always lngPosn = 8.
I would expect lngPosn = 3
I've read help and Ken Getz's Handbook sections on this function
and it appears I am using the function correctly.
I can only conclude that InStrRev does not work in my version of VBA.
Tools References points me to a folder like
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6
and I find these DLLs
VBACV10.DLL
VBACV10D.DLL
VBACV20.DLL
VBE6.DLL
VBE6EXT.OLB
I'm not sure which is the VBA DLL and what the correct version is.
Any help would be appreciated.
Thanks
Zollo A+ / VBA Developer
![[thumbsup] [thumbsup] [thumbsup]](/data/assets/smilies/thumbsup.gif)
InStrRev gets the second space " " not first in A2k VBA6.
Here is part of my code
strStreet = "16 Hely St"
'Value actually from a database
'Value has been trimmed so has no leading or trailing white space.
I've tried these variations:
lngPosn = InStrRev(strStreet, " ")
lngPosn = InStrRev(strStreet, " ", -1, vbTextCompare)
lngPosn = InStrRev(strStreet, " ", len(strStreet), vbTextCompare)
lngPosn = InStrRev(strStreet, Chr(32), -1, vbTextCompare)
lngPosn = InStrRev(strStreet, Chr(32))
lngPosn = InStrRev(strStreet, Chr(32), -1, vbBinaryCompare)
The result is always lngPosn = 8.
I would expect lngPosn = 3
I've read help and Ken Getz's Handbook sections on this function
and it appears I am using the function correctly.
I can only conclude that InStrRev does not work in my version of VBA.
Tools References points me to a folder like
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6
and I find these DLLs
VBACV10.DLL
VBACV10D.DLL
VBACV20.DLL
VBE6.DLL
VBE6EXT.OLB
I'm not sure which is the VBA DLL and what the correct version is.
Any help would be appreciated.
Thanks
Zollo A+ / VBA Developer
![[thumbsup] [thumbsup] [thumbsup]](/data/assets/smilies/thumbsup.gif)