InStrRev & InStr 
Author Message
 InStrRev & InStr

The following function generates an error on the line intx=InStrRev...

Public Function StripPostCode(strValue As String) As String
Dim intX As Variant

intX = InStrRev(Trim(strValue), " ")
StripPostCode = Left(strValue, intX)

End Function

While functions such as the following are fine

Private Function FindDelimiter(strDelimiterValue As String, strText As
String) As Integer
Dim intX As Variant

intX = InStr(Trim(strText), strDelimiterValue)
FindDelimiter = intX

End Function

Any thoughts?

The PC that generates the error is running Access 2000.

Thanks in advance.

Mike Whitaker



Sun, 23 May 2004 16:33:08 GMT  
 InStrRev & InStr
What is the error, Mike?

--

Brendan Reynolds


Quote:

> The following function generates an error on the line intx=InStrRev...

> Public Function StripPostCode(strValue As String) As String
> Dim intX As Variant

> intX = InStrRev(Trim(strValue), " ")
> StripPostCode = Left(strValue, intX)

> End Function

> While functions such as the following are fine

> Private Function FindDelimiter(strDelimiterValue As String, strText As
> String) As Integer
> Dim intX As Variant

> intX = InStr(Trim(strText), strDelimiterValue)
> FindDelimiter = intX

> End Function

> Any thoughts?

> The PC that generates the error is running Access 2000.

> Thanks in advance.

> Mike Whitaker



Sun, 23 May 2004 20:35:02 GMT  
 InStrRev & InStr
I have just been back to the site to get the exact error, only to find that
the program runs as expected.
I can only assume that the reboot this morning did the trick.

I'll be keeping a close eye on things from here.

Thanks,

Mike Whitaker


Quote:
> What is the error, Mike?

> --

> Brendan Reynolds



> > The following function generates an error on the line intx=InStrRev...

> > Public Function StripPostCode(strValue As String) As String
> > Dim intX As Variant

> > intX = InStrRev(Trim(strValue), " ")
> > StripPostCode = Left(strValue, intX)

> > End Function

> > While functions such as the following are fine

> > Private Function FindDelimiter(strDelimiterValue As String, strText As
> > String) As Integer
> > Dim intX As Variant

> > intX = InStr(Trim(strText), strDelimiterValue)
> > FindDelimiter = intX

> > End Function

> > Any thoughts?

> > The PC that generates the error is running Access 2000.

> > Thanks in advance.

> > Mike Whitaker



Mon, 24 May 2004 09:45:56 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. InStr/InStrRev

2. instr & mid function in loop - Please help

3. Question regarding the InStrRev Funciton. Does it really do any thing differnet to InStr???

4. Question regarding the InStrRev Funciton. Does it really do any thing differnet to InStr???

5. Weird InStrRev() behaviour

6. InStrRev Function

7. InstrRev offset not accordingly to documentation

8. InStrRev

9. VB5 Version of InStrRev?

10. InStrRev not working as expected - bug?

11. InStrRev Acting Weird

12. Access Function InStrRev unavailable

 

 
Powered by phpBB® Forum Software