Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange error in query relating to 'Mid' 1

Status
Not open for further replies.

Modex

Programmer
Sep 15, 2002
155
GB
Hi All,

I have little problem, which I cannot understand at all and I wonder if anyone has come across this before.

Basically I run a query with this “Update to” criteria

Mid(Left([Old Filename],Len([Old Filename])-4),myInStrRev([Old Filename],"\")+1)

The problem is, this has worked fine for ages and then after a few updates to code and additional references it no longer works. When I run the query from the form, I get Microsoft Visual Basic error as follows:-

Run-Time error 3085
Undefined Function ‘Mid’ in expression

If I go back to an old version of the database, it works perfectly. I am completely at a loss now, if anyone can help I would be extremely grateful

Many thanks

modeX :-(
 
If it has been working, and you haven't changed anything (relating to this), my guesses are either
1 missing/invalid reference - or
2 code corruption

- not - this is only guessing;-)

1 - in VBE - Tools | References, check if any of the references are marked as missing or invalid. Deselect it, and if necessary reselect it afterwards

2 - This faq Corrupt Microsoft Access MDBs FAQ has a lot of info concerning corruption, symptoms and how to deal with it. MakeItSo's FAQ705-4683 also has some recommandations.

During the last years, I've resolved all my corruption issues using the /decompile option, in stead of importing objects. It's described here Decompile or how to reduce Microsoft Access MDB/MDE size and decrease start-up times

Should it be necessary to import/export all objects, here's also an option that might provide some results Thread705-834817.

Roy-Vidar
 
Hi Roy,

I think Ive cracked it. It was in references as you said. Basically I had been using the DAO 3.5 reference and I updated it to DAO 3.6.

Ive now reverted to 3.5 and its all working again.

What a nightmare, there just seems to be so many varied influences and dependancies when programing in VBA its mind boggling (well, for me anyway)

Many Thanks for the super quick response.

Cheers

modeX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top