InStrRev: invalid procedure call

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
 
B

Bruce M. Thompson

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?
 
K

Kenny-Z

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
 
K

Kenny-Z

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top