Cannot delete VBA References

highandwild

Registered User.
Local time
Today, 23:54
Joined
Oct 30, 2009
Messages
435
In an attempt to resolve a query compile error it has been suggested that I delete and reselect various VBA references. I can delete some but not the following:

Microsoft Access 14.0 Object Library
Visual Basic For Applications

It tells me that they are in use and so cannot be deleted.

I have created a new empty database and tried to delete them and I get the same error message.

Any ideas?
 
Those two references are a part of the Access 2010 applicaion and I would not expect that you would be able to remove them.

If you have removed the other references, did that resolve your issue?
 
Thanks Mr B for that knowledge.

I have been able to delete the other referencves, unload, load and then reselect
but that did not sort the query problem out.

I have created a new database and imported all obects and still no luck.
 
I had two 'Option Explicit' statements at the start of a Module.

This caused the query problem.

I wish Access would not throw red herrings into the arena.

Move on now after that waste of time............
 
Glad you were able to at least find where the problem was being initiated.

Good luck with your project.
 
mind you

having option explicit set is GOOD practice

you ought to have identified the REAL error that caused your problem.
 
Gemma

I had TWO 'Option Explicit' statements in the module so I removed one and that solved the problem.

I seem to recall that I hads a similar problem years ago when I had two 'end function' lines at the end of a function.

If Access presented a sensible error message then it would be so much easier to fix.
 
Gemma

I had TWO 'Option Explicit' statements in the module so I removed one and that solved the problem.

I seem to recall that I hads a similar problem years ago when I had two 'end function' lines at the end of a function.

If Access presented a sensible error message then it would be so much easier to fix.


ah, i see - that can happens when you copy and paste code. (I thought you meant errors caused by having option explicit)

either a whole module, (so you get the option epxlicit twice) -

or a function/sub

ie - you create an empty event handler. then copy the same event handler from another form. now you have two headers, and two exit subs for the event.
 
If a query requires a Function in a module then all the code in that module needs to be capable of being compiled. The attempt to compile all the code failed and so the query could not run.

The root cause of your problem is that you did not compile the code in the module.

Chris.
 

Users who are viewing this thread

Back
Top Bottom