InStrRev: invalid procedure call

  • Thread starter Thread starter Kenny-Z
  • Start date Start date
K

Kenny-Z

Hi group,

I have a class module in an Access app that has been working fine for
years; now all it does is throw an error at a call to InStrRev() (3rd
line of function below). The code compiles fine, InStrRev() appears in
the object browser. What the bloody heck can be wrong? InStr() works
fine. Thanks for any help...

Private Sub GetDatePartPositions()
strCurrentText = txtDateBox.Text
intDayPosition = InStr(1, strCurrentText, "/")
intYearPosition = InStrRev(strCurrentText, "/")
End Sub
 
I have a class module in an Access app that has been working fine for
years; now all it does is throw an error at a call to InStrRev() (3rd
line of function below). The code compiles fine, InStrRev() appears in
the object browser. What the bloody heck can be wrong? InStr() works
fine. Thanks for any help...

Private Sub GetDatePartPositions()
strCurrentText = txtDateBox.Text
intDayPosition = InStr(1, strCurrentText, "/")
intYearPosition = InStrRev(strCurrentText, "/")
End Sub

So ... what is the error message?
 
Bruce M. Thompson said:
So ... what is the error message?

Oh, sorry, I only gave a clue in the subject... The error message is
"Invalid procedure call or argument". But it had been valid for years
and no other VBA library procedures seem to be 'broken'.

thanks for your time,

Ken
 
Thanks for the tips, all. Still no luck. When I get more time (to
waste?), I might next try importing to a new MDB... Its probably time
anyway.

On a further note, I also have this module in two other MDBs. I opened
one and it ran fine (with InStrRev) until the project was recompiled,
in which case InStrRev broke again. The third MDB app works fine with
this function call even after a recompile..(. As is this stuff can't
get complicated enough on its own...I suppose its the price we pay for
the power and affordability of Access)

regards,

kz
 
Back
Top