Using an Access Library in Access 2000

T

Tom Bynum

I'm trying to consolidate a bunch of things into a Library database that's
loaded as a reference in Access 2000



Here's what I've done so far: (this is a highly simplified example)



Two databases:



->UserInterface.mdb

Contains all sorts of forms, reports



-> CodeLibrary.mdb

Contains 1 module named "ValidateStuff" and 1 form named
"LookUpStuff"



UserInterface includes Codelibrary as a reference.

CodeLibrary includes an external DLL reference to do some work with a 3rd
party product. Let's call it, Product.dll



Here's the chain of events as they are supposed to happen:



In UserInterface:

User types in some stuff



An afterupdate event calls module named ValidateStuff (kept in
the codelibrary)



ValidateStuff uses the Product.DLL to test the stuff against the
vendor's catalog



If Stuff is OK then

the module returns OK to the calling form with some additional info from the
catalog

else

the module opens the form LookUpStuff (also kept in CodeLibrary) to allow
user to find stuff in the vendor catalog (using the product.dll). When they
find what the want, it gets put back on the calling form and the lookup form
closes.

end if





Now for the Problem:

All the Lookup stuff works great - EXCEPT - when you try to close Access.IT
WON'T CLOSE!

I have to use Task Manager to kill the lingering MSACCESS process.



If I remove the reference to CodeLibrary, everything goes back to normal.



Any ideas?
 
D

Dan Artuso

Hi,
Somewhere in your code you may be instantiating/opening an object
and not releasing the reference to it.
 
M

Marshall Barton

Tom said:
I'm trying to consolidate a bunch of things into a Library database that's
loaded as a reference in Access 2000
[snip]

All the Lookup stuff works great - EXCEPT - when you try to close Access.IT
WON'T CLOSE!

I have to use Task Manager to kill the lingering MSACCESS process.

If I remove the reference to CodeLibrary, everything goes back to normal.

It sounds like the code library db has an open reference to
some object. If you open an object, you should close and
set the variable to Nothing to make sure the reference is
cleared. Most of the time Access takes care of this kind of
thing when the object variable goes out of scope, but
sometimes things slip through so you should clean up as soon
as you're done using the object.
 

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