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!

VB cannot find mid() 2

Status
Not open for further replies.

Rolliee

Programmer
Jun 23, 2002
1,551
US
Why is it that there are times when an 'mdb' cannot find mid() or right() or left()

It must be some reference but which????

Somehow I always get out of it but do not know how or why.


Rollie E
 
Hiya,

This IS due to a library reference.

Are you having this problem after developing the app. on one machine, then moving the app. to another machine?

I've had this recently, and it's one of:

MS DAO (ADO etc).
MS ActiveX Data objects
MS Access x.x Object library
MS Visual Basic for Applications (unlikely ;-) ).

You set the references by going into some VB code, Tools->
References.

Regards,

Darrylle


"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Hello Rolliee

I have come across this when an object library is required but has not been referenced (Tools...References) or a control has been used but not properly registered. Then certain functions fail e.g. Left().

Is there any additional control or reference on any of your forms?

Is the application one you have built on your own machine or supplied by someone who had Visual Basic/Visual Studio on their machine?

A possible solution may be to open a blank database and using File...Get ExternalData...Import and import all the tables, forms etc. from the original .mdb.

A Tools...Compact and Repair may help.

I remember similar problems with this. Somtimes you can get into real difficulties with Access and it can take ages to sort out.

Thanks

Michael
 
I did check on references and they all seemed to be okay.

What happened and I know not why is I found a Null in the argumants of mid(). I had to go out of ACCESS and come back in with the Null problem fixed and it worked.

If anyone knkows the mechanism, please share it with me.

Rollie E
 
Another option to try when a standard function doesn't work is to open up any code module, click on tools references and then click on any reference (be sure to note which one you clicked on). Then click on OK and click on Tools References and unclick the reference you clicked on above. After that, click on OK and then click on Debug, Compile and Save all Modules. After that, it should work again. You may also want to compact the database if you have time.
 
Access library references are prioritized. So if the DAO lib is way down in the list with the ADO libs above it, DAO commands won't work. Old mainframe programmers who had to use JCL knows what I mean.
Also, and this is sick, sometimes you will get an error, click on "DEBUG", go into VBA, select or change the position of a reference, come out of VBA and still get the error because the reference didn't take. So you must close the VBA opened from DEBUG, reopen VBA, make the reference, close VBA and then it works.

Neil
 
Hi,

fneily - yep - totally agree with you.

I have the problem that I have an early verion library, I select a later version library and try to prioritise it and VB says - 'Sorry, can't prioritise because the (early version' library is currently in use'!

Total waste of time. You've got to 1st get rid of the earlier version and THEN add the later.

Regards

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top