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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I call a function in a DIFFERENT .mdb?

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
I have C:\a.mdb and C:\b.mdb. How do I call a function in b.mdb from a function a.mdb?
 
Whoa! I think I answered my own question. Check this out:

Dim appAccess As New Access.Application
appAccess.OpenCurrentDatabase ("C:\xyz\alpha.mdb"), True, "we27p"
appAccess.Run "x", "eee", 1

PS: At the end, do I need to do something to destroy appAccess and clean up the garbage? That object must be pretty memory-intensive.
 
Umm... Maybe I'm missing something, but why? Why not just copy or import the function, rather than opening another db at runtime?

Ken S.
 
What about using tools references and browsing to the function to select it?
 
Here is some context. While I am running a.mdb, I need to tell b.mdb to import data into itself.
 
Could you import the data in your current db and then send it to the other? I used to run a database that didn't have tables in it. It had make table queries that looked at database 1 (using the IN statement) and then the results were saved to database 3, this method used only 1 query to get the data and save it elsewhere.
 
clean up the garbage
appAccess.Quit
Set appAccess = Nothing

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top